Skip to content

Commit 0e64d95

Browse files
authored
CrewAI Flow support (#119)
1 parent 323aa18 commit 0e64d95

30 files changed

+6283
-1
lines changed

typescript-sdk/apps/dojo/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
"@ag-ui/server-starter": "workspace:*",
1818
"@ag-ui/server-starter-all-features": "workspace:*",
1919
"@ag-ui/vercel-ai-sdk": "workspace:*",
20+
"@ag-ui/crewai": "workspace:*",
2021
"@ai-sdk/openai": "^1.3.22",
2122
"@copilotkit/react-core": "1.8.14-next.4",
2223
"@copilotkit/react-ui": "1.8.14-next.4",

typescript-sdk/apps/dojo/src/agents.ts

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import { openai } from "@ai-sdk/openai";
99
import { LangGraphAgent } from "@ag-ui/langgraph";
1010
import { AgnoAgent } from "@ag-ui/agno";
1111
import { LlamaIndexAgent } from "@ag-ui/llamaindex";
12+
import { CrewAIAgent } from "@ag-ui/crewai";
1213

1314
export const agentsIntegrations: AgentIntegrationConfig[] = [
1415
{
@@ -131,5 +132,30 @@ export const agentsIntegrations: AgentIntegrationConfig[] = [
131132
}),
132133
};
133134
},
134-
}
135+
},
136+
{
137+
id: "crewai",
138+
agents: async () => {
139+
return {
140+
agentic_chat: new CrewAIAgent({
141+
url: "http://localhost:8000/agentic_chat",
142+
}),
143+
human_in_the_loop: new CrewAIAgent({
144+
url: "http://localhost:8000/human_in_the_loop",
145+
}),
146+
tool_based_generative_ui: new CrewAIAgent({
147+
url: "http://localhost:8000/tool_based_generative_ui",
148+
}),
149+
agentic_generative_ui: new CrewAIAgent({
150+
url: "http://localhost:8000/agentic_generative_ui",
151+
}),
152+
shared_state: new CrewAIAgent({
153+
url: "http://localhost:8000/shared_state",
154+
}),
155+
predictive_state_updates: new CrewAIAgent({
156+
url: "http://localhost:8000/predictive_state_updates",
157+
}),
158+
};
159+
},
160+
},
135161
];

typescript-sdk/apps/dojo/src/menu.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,11 +53,18 @@ export const menuIntegrations: MenuIntegrationConfig[] = [
5353
{
5454
id: "llama-index",
5555
name: "LlamaIndex",
56+
features: ["agentic_chat", "human_in_the_loop", "agentic_generative_ui", "shared_state"],
57+
},
58+
{
59+
id: "crewai",
60+
name: "CrewAI",
5661
features: [
5762
"agentic_chat",
5863
"human_in_the_loop",
64+
"tool_based_generative_ui",
5965
"agentic_generative_ui",
6066
"shared_state",
67+
"predictive_state_updates",
6168
],
6269
},
6370
];
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
.turbo
2+
.DS_Store
3+
.git
4+
.gitignore
5+
.idea
6+
.vscode
7+
.env
8+
__tests__
9+
src
10+
tsup.config.ts
11+
tsconfig.json
12+
jest.config.js
13+
server
14+
python
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# Server Starter
2+
3+
This starter kit demonstrates sending the minimal set of events that are needed to stream data from the agent to the frontend.
4+
5+
## Running the server
6+
7+
To run the server:
8+
9+
```bash
10+
cd typescript-sdk/integrations/server-starter/server/python
11+
12+
poetry install && poetry run dev
13+
```
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
/** @type {import('ts-jest').JestConfigWithTsJest} */
2+
module.exports = {
3+
preset: "ts-jest",
4+
testEnvironment: "node",
5+
testMatch: ["**/*.test.ts"],
6+
moduleNameMapper: {
7+
"^@/(.*)$": "<rootDir>/src/$1",
8+
},
9+
};
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
{
2+
"name": "@ag-ui/crewai",
3+
"author": "Markus Ecker <[email protected]>",
4+
"version": "0.0.1",
5+
"main": "./dist/index.js",
6+
"module": "./dist/index.mjs",
7+
"types": "./dist/index.d.ts",
8+
"sideEffects": false,
9+
"files": [
10+
"dist/**"
11+
],
12+
"scripts": {
13+
"build": "tsup",
14+
"dev": "tsup --watch",
15+
"clean": "rm -rf dist",
16+
"typecheck": "tsc --noEmit",
17+
"test": "jest",
18+
"link:global": "pnpm link --global",
19+
"unlink:global": "pnpm unlink --global"
20+
},
21+
"dependencies": {
22+
"@ag-ui/client": "workspace:*"
23+
},
24+
"peerDependencies": {
25+
"rxjs": "7.8.1"
26+
},
27+
"devDependencies": {
28+
"@types/jest": "^29.5.14",
29+
"@types/node": "^20.11.19",
30+
"jest": "^29.7.0",
31+
"ts-jest": "^29.1.2",
32+
"tsup": "^8.0.2",
33+
"typescript": "^5.3.3"
34+
}
35+
}
Lines changed: 140 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,140 @@
1+
# Byte-compiled / optimized / DLL files
2+
__pycache__/
3+
*.py[cod]
4+
*$py.class
5+
6+
# C extensions
7+
*.so
8+
9+
# Distribution / packaging
10+
.Python
11+
build/
12+
develop-eggs/
13+
dist/
14+
downloads/
15+
eggs/
16+
.eggs/
17+
lib/
18+
lib64/
19+
parts/
20+
sdist/
21+
var/
22+
wheels/
23+
pip-wheel-metadata/
24+
share/python-wheels/
25+
*.egg-info/
26+
.installed.cfg
27+
*.egg
28+
MANIFEST
29+
30+
# PyInstaller
31+
# Usually these files are written by a python script from a template
32+
# before PyInstaller builds the exe, so as to inject date/other infos into it.
33+
*.manifest
34+
*.spec
35+
36+
# Installer logs
37+
pip-log.txt
38+
pip-delete-this-directory.txt
39+
40+
# Unit test / coverage reports
41+
htmlcov/
42+
.tox/
43+
.nox/
44+
.coverage
45+
.coverage.*
46+
.cache
47+
nosetests.xml
48+
coverage.xml
49+
*.cover
50+
*.py,cover
51+
.hypothesis/
52+
.pytest_cache/
53+
54+
# Translations
55+
*.mo
56+
*.pot
57+
58+
# Django stuff:
59+
*.log
60+
local_settings.py
61+
db.sqlite3
62+
db.sqlite3-journal
63+
64+
# Flask stuff:
65+
instance/
66+
.webassets-cache
67+
68+
# Scrapy stuff:
69+
.scrapy
70+
71+
# Sphinx documentation
72+
docs/_build/
73+
74+
# PyBuilder
75+
target/
76+
77+
# Jupyter Notebook
78+
.ipynb_checkpoints
79+
80+
# IPython
81+
profile_default/
82+
ipython_config.py
83+
84+
# pyenv
85+
.python-version
86+
87+
# pipenv
88+
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
89+
# However, in case of collaboration, if having platform-specific dependencies or dependencies
90+
# having no cross-platform support, pipenv may install dependencies that don't work, or not
91+
# install all needed dependencies.
92+
#Pipfile.lock
93+
94+
# PEP 582; used by e.g. github.com/David-OConnor/pyflow
95+
__pypackages__/
96+
97+
# Celery stuff
98+
celerybeat-schedule
99+
celerybeat.pid
100+
101+
# SageMath parsed files
102+
*.sage.py
103+
104+
# Environments
105+
.env
106+
.venv
107+
env/
108+
venv/
109+
ENV/
110+
env.bak/
111+
venv.bak/
112+
113+
# Spyder project settings
114+
.spyderproject
115+
.spyproject
116+
117+
# Rope project settings
118+
.ropeproject
119+
120+
# mkdocs documentation
121+
/site
122+
123+
# mypy
124+
.mypy_cache/
125+
.dmypy.json
126+
dmypy.json
127+
128+
# Pyre type checker
129+
.pyre/
130+
131+
# IDE
132+
.vscode/
133+
.idea/
134+
*.swp
135+
*.swo
136+
*~
137+
138+
# OS
139+
.DS_Store
140+
Thumbs.db

typescript-sdk/integrations/crewai/python/README.md

Whitespace-only changes.
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
from .endpoint import add_crewai_fastapi_endpoint
2+
from .sdk import (
3+
CopilotKitState,
4+
copilotkit_predict_state,
5+
copilotkit_emit_state,
6+
copilotkit_stream
7+
)
8+
__all__ = [
9+
"add_crewai_fastapi_endpoint",
10+
"CopilotKitState",
11+
"copilotkit_predict_state",
12+
"copilotkit_emit_state",
13+
"copilotkit_stream"
14+
]

0 commit comments

Comments
 (0)