From 73c4edeff404507fa3d400cf1a7e73460d5efa47 Mon Sep 17 00:00:00 2001 From: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> Date: Wed, 30 Apr 2025 20:26:37 +0000 Subject: [PATCH 1/9] Add Python SDK documentation for async and agent-to-agent features Co-Authored-By: jhaynie@agentuity.com --- content/docs/SDKs/python/agent-to-agent.mdx | 93 ++++++++++++++ content/docs/SDKs/python/async-api.mdx | 86 +++++++++++++ content/docs/SDKs/python/crewai.mdx | 12 +- content/docs/SDKs/python/data-handling.mdx | 124 +++++++++++++++++++ content/docs/SDKs/python/getting-started.mdx | 73 +++++++++++ content/docs/SDKs/python/index.mdx | 38 ++++++ content/docs/SDKs/python/meta.json | 3 + 7 files changed, 427 insertions(+), 2 deletions(-) create mode 100644 content/docs/SDKs/python/agent-to-agent.mdx create mode 100644 content/docs/SDKs/python/async-api.mdx create mode 100644 content/docs/SDKs/python/data-handling.mdx create mode 100644 content/docs/SDKs/python/getting-started.mdx create mode 100644 content/docs/SDKs/python/index.mdx create mode 100644 content/docs/SDKs/python/meta.json diff --git a/content/docs/SDKs/python/agent-to-agent.mdx b/content/docs/SDKs/python/agent-to-agent.mdx new file mode 100644 index 00000000..e4e4f4a4 --- /dev/null +++ b/content/docs/SDKs/python/agent-to-agent.mdx @@ -0,0 +1,93 @@ +--- +title: Agent-to-Agent Communication +description: Enable communication between agents in the Agentuity Python SDK +--- + +# Agent-to-Agent Communication + +The Agentuity Python SDK enables seamless communication between agents, whether they are running locally or in different environments. + +## Local Agent Communication + +You can easily communicate between agents running in the same process: + +```python +async def run(request, response, context): + # Call another agent by ID + result = await response.handoff({"id": "other_agent_id"}) + return result + + # Or call by name + # result = await response.handoff({"name": "OtherAgentName"}) + # return result +``` + +## Remote Agent Communication + +The SDK now supports communication with agents running in different environments: + +```python +async def run(request, response, context): + # Resolve an agent (local or remote) + agent = context.get_agent("remote_agent_id") + + # Create data for the remote agent + from agentuity.server.data import Data, StringStreamReader + data = Data("text/plain", StringStreamReader("Hello from another agent")) + + # Call the remote agent + result = await agent.run(data, metadata={"key": "value"}) + + # Process the response + text = await result.data.text() + return response.text(f"Got response: {text}") +``` + +## Agent Resolution + +The `resolve_agent` function automatically determines whether to create a local or remote agent instance: + +```python +from agentuity.server.agent import resolve_agent + +async def run(request, response, context): + # Resolve by ID + agent = resolve_agent(context, "agent_id") + + # Resolve by name + agent = resolve_agent(context, {"name": "AgentName"}) + + # Resolve by name in a specific project + agent = resolve_agent(context, {"name": "AgentName", "projectId": "proj_123"}) + + # Call the resolved agent + result = await agent.run(request.data) + return result +``` + +## Agent Context + +The `AgentContext` class provides methods for agent resolution and management: + +```python +async def run(request, response, context): + # Get agent information + current_agent = context.agent + all_agents = context.agents + + # Get the current scope (local or remote) + scope = context.scope + + # Get the current run ID + run_id = context.runId + + # Use key-value store + await context.kv.set("key", "value") + value = await context.kv.get("key") + + # Use vector store + await context.vector.add("collection", "id", [0.1, 0.2, 0.3], {"metadata": "value"}) + results = await context.vector.search("collection", [0.1, 0.2, 0.3], 5) + + return response.text("Agent context example") +``` diff --git a/content/docs/SDKs/python/async-api.mdx b/content/docs/SDKs/python/async-api.mdx new file mode 100644 index 00000000..75b1c7a5 --- /dev/null +++ b/content/docs/SDKs/python/async-api.mdx @@ -0,0 +1,86 @@ +--- +title: Async API +description: Working with Asynchronous Agents in the Agentuity Python SDK +--- + +# Async API + +The Agentuity Python SDK now supports fully asynchronous operations, enabling more efficient handling of concurrent requests and streaming responses. + +## Agent Request + +The `AgentRequest` class now uses async patterns to handle incoming data: + +```python +from agentuity.server import AgentRequest + +async def run(request: AgentRequest, response, context): + # Access request data asynchronously + data = await request.data.text() + + # Access request metadata + metadata = request.metadata + + # Get the trigger type + trigger = request.trigger + + # Return a response + return response.text(f"Received: {data}") +``` + +## Agent Response + +The `AgentResponse` class supports async streaming and iteration: + +```python +from agentuity.server import AgentResponse + +async def run(request, response: AgentResponse, context): + # Stream response data + async def data_generator(): + for i in range(5): + yield f"Data chunk {i}\n" + + # Return a streaming response + return response.stream(data_generator(), contentType="text/plain") +``` + +### Async Iteration + +Responses can be iterated over asynchronously: + +```python +async def process_response(response): + async for chunk in response: + print(chunk) +``` + +## Data Streaming + +The SDK provides several specialized stream readers for different data types: + +```python +from agentuity.server.data import ( + StringStreamReader, + BytesStreamReader, + EmptyDataReader +) + +# Create a stream from a string +string_stream = StringStreamReader("Hello, world!") + +# Create a stream from bytes +bytes_stream = BytesStreamReader(b"Binary data") + +# Create an empty stream +empty_stream = EmptyDataReader() +``` + +## Performance Benefits + +The async implementation provides several advantages: + +- Efficient handling of concurrent requests +- Streaming of large data payloads without blocking +- Reduced memory usage for processing large files +- Better integration with modern async Python applications diff --git a/content/docs/SDKs/python/crewai.mdx b/content/docs/SDKs/python/crewai.mdx index a4c87cd2..dc889968 100644 --- a/content/docs/SDKs/python/crewai.mdx +++ b/content/docs/SDKs/python/crewai.mdx @@ -1,12 +1,20 @@ --- title: CrewAI -description: CrewAI SDK +description: Building AI agent teams with CrewAI and Agentuity --- -CrewAI is a framework for building AI agents. It is a Python library that allows you to build agents that can be used to automate tasks. +# CrewAI + +CrewAI is a framework for building teams of AI agents. When integrated with Agentuity, you can create powerful multi-agent systems that collaborate on complex tasks. ## Installation ```bash pip install crewai ``` + +## Integration with Agentuity + +CrewAI can be integrated with Agentuity to leverage Agentuity's agent management and communication capabilities. + +For more details, see the [CrewAI documentation](https://docs.crewai.com/). diff --git a/content/docs/SDKs/python/data-handling.mdx b/content/docs/SDKs/python/data-handling.mdx new file mode 100644 index 00000000..856b53b8 --- /dev/null +++ b/content/docs/SDKs/python/data-handling.mdx @@ -0,0 +1,124 @@ +--- +title: Data Handling +description: Working with various data types in the Agentuity Python SDK +--- + +# Data Handling + +The Agentuity Python SDK provides a flexible system for working with different types of data, from text and JSON to binary formats like images and audio. + +## The Data Class + +The `Data` class serves as a container for all types of content: + +```python +from agentuity.server.data import Data, StringStreamReader, BytesStreamReader + +# Create a text Data object +text_data = Data("text/plain", StringStreamReader("Hello, world!")) + +# Create a binary Data object +binary_data = Data("application/octet-stream", BytesStreamReader(b"\x00\x01\x02\x03")) +``` + +## Accessing Data Content + +Data content can be accessed in various formats: + +```python +async def process_data(data: Data): + # Get as text + text = await data.text() + + # Get as JSON + json_data = await data.json() + + # Get as binary + binary = await data.binary() + + # Get as base64 encoded string + base64_str = await data.base64() + + # Access as a stream + stream = await data.stream() + async for chunk in stream: + process_chunk(chunk) +``` + +## Working with Responses + +The `AgentResponse` class provides methods for various content types: + +```python +async def run(request, response, context): + # Text response + return response.text("Hello, world!") + + # HTML response + return response.html("

Hello, world!

") + + # JSON response + return response.json({"message": "Hello, world!"}) + + # Markdown response + return response.markdown("# Hello, world!") + + # Binary response + return response.binary(b"\x00\x01\x02\x03", "application/octet-stream") + + # Empty response with metadata + return response.empty({"status": "processed"}) +``` + +## Media Type Helpers + +The SDK includes helpers for common media types: + +```python +async def run(request, response, context): + # Image responses + with open("image.png", "rb") as f: + image_data = f.read() + return response.png(image_data) + + # Other image formats + return response.jpeg(jpeg_data) + return response.gif(gif_data) + return response.webp(webp_data) + + # Document formats + return response.pdf(pdf_data) + + # Audio/Video formats + return response.mp3(mp3_data) + return response.mp4(mp4_data) + return response.wav(wav_data) + return response.ogg(ogg_data) + return response.webm(webm_data) + return response.m4a(m4a_data) +``` + +## Streaming Data + +For large responses or real-time data, use streaming: + +```python +async def run(request, response, context): + # Stream data from a generator + async def generator(): + for i in range(10): + yield f"Item {i}\n" + + # Return the stream + return response.stream(generator(), contentType="text/plain") + + # Transform items during streaming + def transform(item): + return f"Transformed: {item}" + + return response.stream(generator(), transform=transform) + + # Stream responses from another agent + other_response = await context.get_agent("other_agent").run(request.data) + return response.stream(other_response) +``` diff --git a/content/docs/SDKs/python/getting-started.mdx b/content/docs/SDKs/python/getting-started.mdx new file mode 100644 index 00000000..8153c568 --- /dev/null +++ b/content/docs/SDKs/python/getting-started.mdx @@ -0,0 +1,73 @@ +--- +title: Getting Started with Python SDK +description: Learn how to get started with the Agentuity Python SDK +--- + +# Getting Started with Python SDK + +This guide will help you quickly set up and create your first agent using the Agentuity Python SDK. + +## Prerequisites + +- [Python](https://www.python.org/) (3.10 or 3.11) +- [uv](https://docs.astral.sh/uv/) (latest version recommended) + +## Installation + +First, install the Agentuity CLI: + +```bash +curl -sSL https://agentuity.sh/install.sh | bash +``` + +Then create a new project: + +```bash +agentuity new +``` + +## Creating Your First Agent + +Create a minimal `agentuity.yaml` file in your project root: + +```yaml +project_id: proj_mv0w67c4851eX0oTglYLzP3OgS2BjN54 +name: test +agents: + - id: agent_HaDpiH67c4851eISzbAWfZqwLtnpguW6 + name: myfirstagent +``` + +Next, create your agent file: + +```bash +mkdir -p agents/myfirstagent +touch agents/myfirstagent/agent.py +``` + +Add the following code to your agent file: + +```python +def run(request, response, context): + return response.text("Hello, world") +``` + +## Running Your Agent + +Start the local development server: + +```bash +uv run test.py +``` + +Test your agent by sending a request: + +```bash +curl -v http://localhost:3500/agent_HaDpiH67c4851eISzbAWfZqwLtnpguW6 --json '{"hello":"world"}' +``` + +## Next Steps + +- Learn about the [Async API](/docs/SDKs/python/async-api) +- Explore [Agent-to-Agent Communication](/docs/SDKs/python/agent-to-agent) +- Understand [Data Handling](/docs/SDKs/python/data-handling) diff --git a/content/docs/SDKs/python/index.mdx b/content/docs/SDKs/python/index.mdx new file mode 100644 index 00000000..1011ceaf --- /dev/null +++ b/content/docs/SDKs/python/index.mdx @@ -0,0 +1,38 @@ +--- +title: Python SDK +description: Agentuity Python SDK Documentation +--- + +# Agentuity Python SDK + +The Agentuity Python SDK is a powerful toolkit for building, deploying, and managing AI agents in Python environments. This SDK provides developers with a comprehensive set of tools to create intelligent agents that can process various types of content, communicate with each other, and integrate with external systems. + +## Installation + +```bash +pip install agentuity +``` + +## Key Features + +
+ +

Getting Started

+

Quick start guide for building your first agent

+
+ + +

Async API

+

Work with fully asynchronous agents

+
+ + +

Agent-to-Agent Communication

+

Enable communication between local and remote agents

+
+ + +

Data Handling

+

Work with various data types and streaming capabilities

+
+
diff --git a/content/docs/SDKs/python/meta.json b/content/docs/SDKs/python/meta.json new file mode 100644 index 00000000..792630f7 --- /dev/null +++ b/content/docs/SDKs/python/meta.json @@ -0,0 +1,3 @@ +{ + "title": "Python SDK" +} From a8b394095d453304055937abd340619ee7caf5e5 Mon Sep 17 00:00:00 2001 From: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> Date: Wed, 30 Apr 2025 20:42:26 +0000 Subject: [PATCH 2/9] Update Python SDK documentation based on PR feedback Co-Authored-By: jhaynie@agentuity.com --- content/docs/SDKs/python/getting-started.mdx | 31 +++++++------------- content/docs/SDKs/python/index.mdx | 12 +++++++- 2 files changed, 21 insertions(+), 22 deletions(-) diff --git a/content/docs/SDKs/python/getting-started.mdx b/content/docs/SDKs/python/getting-started.mdx index 8153c568..7ec29dc8 100644 --- a/content/docs/SDKs/python/getting-started.mdx +++ b/content/docs/SDKs/python/getting-started.mdx @@ -26,29 +26,22 @@ Then create a new project: agentuity new ``` -## Creating Your First Agent - -Create a minimal `agentuity.yaml` file in your project root: +This will create a new project with a default `agentuity.yaml` configuration file and agent structure. -```yaml -project_id: proj_mv0w67c4851eX0oTglYLzP3OgS2BjN54 -name: test -agents: - - id: agent_HaDpiH67c4851eISzbAWfZqwLtnpguW6 - name: myfirstagent -``` +## Creating Your First Agent -Next, create your agent file: +Navigate to the agent file created by the CLI: ```bash -mkdir -p agents/myfirstagent -touch agents/myfirstagent/agent.py +cd agents/myfirstagent ``` -Add the following code to your agent file: +Edit the `agent.py` file and add the following code: ```python -def run(request, response, context): +from agentuity.server import AgentRequest, AgentResponse, AgentContext + +def run(request: AgentRequest, response: AgentResponse, context: AgentContext): return response.text("Hello, world") ``` @@ -57,14 +50,10 @@ def run(request, response, context): Start the local development server: ```bash -uv run test.py +agentuity dev ``` -Test your agent by sending a request: - -```bash -curl -v http://localhost:3500/agent_HaDpiH67c4851eISzbAWfZqwLtnpguW6 --json '{"hello":"world"}' -``` +When the server starts, you'll see a local URL in the console output. Open this URL in your browser to access the Agentuity development UI, where you can test your agent and view the responses. ## Next Steps diff --git a/content/docs/SDKs/python/index.mdx b/content/docs/SDKs/python/index.mdx index 1011ceaf..94949a18 100644 --- a/content/docs/SDKs/python/index.mdx +++ b/content/docs/SDKs/python/index.mdx @@ -9,10 +9,20 @@ The Agentuity Python SDK is a powerful toolkit for building, deploying, and mana ## Installation +First, install the Agentuity CLI: + +```bash +curl -sSL https://agentuity.sh/install.sh | bash +``` + +Then create a new project: + ```bash -pip install agentuity +agentuity new ``` +This will set up a new project with the Python SDK already configured. + ## Key Features
From 556c9395eb31b73ebbeb319404c4a7a373f73e43 Mon Sep 17 00:00:00 2001 From: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> Date: Wed, 30 Apr 2025 20:50:31 +0000 Subject: [PATCH 3/9] Update agent-to-agent communication example based on PR feedback Co-Authored-By: jhaynie@agentuity.com --- content/docs/SDKs/python/agent-to-agent.mdx | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/content/docs/SDKs/python/agent-to-agent.mdx b/content/docs/SDKs/python/agent-to-agent.mdx index e4e4f4a4..339d3d74 100644 --- a/content/docs/SDKs/python/agent-to-agent.mdx +++ b/content/docs/SDKs/python/agent-to-agent.mdx @@ -14,12 +14,10 @@ You can easily communicate between agents running in the same process: ```python async def run(request, response, context): # Call another agent by ID - result = await response.handoff({"id": "other_agent_id"}) - return result + return await response.handoff({"id": "other_agent_id"}) # Or call by name - # result = await response.handoff({"name": "OtherAgentName"}) - # return result + # return response.handoff({"name": "OtherAgentName"}) ``` ## Remote Agent Communication From f645d1c70b8d924b592a505e3c7c4c07c42a9270 Mon Sep 17 00:00:00 2001 From: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> Date: Thu, 1 May 2025 03:08:29 +0000 Subject: [PATCH 4/9] Remove non-existent response methods from data-handling documentation Co-Authored-By: jhaynie@agentuity.com --- content/docs/SDKs/python/data-handling.mdx | 6 ------ 1 file changed, 6 deletions(-) diff --git a/content/docs/SDKs/python/data-handling.mdx b/content/docs/SDKs/python/data-handling.mdx index 856b53b8..a558463d 100644 --- a/content/docs/SDKs/python/data-handling.mdx +++ b/content/docs/SDKs/python/data-handling.mdx @@ -54,9 +54,6 @@ async def run(request, response, context): # Text response return response.text("Hello, world!") - # HTML response - return response.html("

Hello, world!

") - # JSON response return response.json({"message": "Hello, world!"}) @@ -65,9 +62,6 @@ async def run(request, response, context): # Binary response return response.binary(b"\x00\x01\x02\x03", "application/octet-stream") - - # Empty response with metadata - return response.empty({"status": "processed"}) ``` ## Media Type Helpers From 1f9a99d2554f1a36754ebd0c074c3f6efa57b615 Mon Sep 17 00:00:00 2001 From: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> Date: Thu, 1 May 2025 03:08:59 +0000 Subject: [PATCH 5/9] Remove redundant getting-started.mdx as content is in index.mdx Co-Authored-By: jhaynie@agentuity.com --- content/docs/SDKs/python/getting-started.mdx | 62 -------------------- 1 file changed, 62 deletions(-) delete mode 100644 content/docs/SDKs/python/getting-started.mdx diff --git a/content/docs/SDKs/python/getting-started.mdx b/content/docs/SDKs/python/getting-started.mdx deleted file mode 100644 index 7ec29dc8..00000000 --- a/content/docs/SDKs/python/getting-started.mdx +++ /dev/null @@ -1,62 +0,0 @@ ---- -title: Getting Started with Python SDK -description: Learn how to get started with the Agentuity Python SDK ---- - -# Getting Started with Python SDK - -This guide will help you quickly set up and create your first agent using the Agentuity Python SDK. - -## Prerequisites - -- [Python](https://www.python.org/) (3.10 or 3.11) -- [uv](https://docs.astral.sh/uv/) (latest version recommended) - -## Installation - -First, install the Agentuity CLI: - -```bash -curl -sSL https://agentuity.sh/install.sh | bash -``` - -Then create a new project: - -```bash -agentuity new -``` - -This will create a new project with a default `agentuity.yaml` configuration file and agent structure. - -## Creating Your First Agent - -Navigate to the agent file created by the CLI: - -```bash -cd agents/myfirstagent -``` - -Edit the `agent.py` file and add the following code: - -```python -from agentuity.server import AgentRequest, AgentResponse, AgentContext - -def run(request: AgentRequest, response: AgentResponse, context: AgentContext): - return response.text("Hello, world") -``` - -## Running Your Agent - -Start the local development server: - -```bash -agentuity dev -``` - -When the server starts, you'll see a local URL in the console output. Open this URL in your browser to access the Agentuity development UI, where you can test your agent and view the responses. - -## Next Steps - -- Learn about the [Async API](/docs/SDKs/python/async-api) -- Explore [Agent-to-Agent Communication](/docs/SDKs/python/agent-to-agent) -- Understand [Data Handling](/docs/SDKs/python/data-handling) From 6841ce6e8eebf70adc6304f653c70f2d872a5219 Mon Sep 17 00:00:00 2001 From: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> Date: Thu, 1 May 2025 03:09:54 +0000 Subject: [PATCH 6/9] Merge getting-started content into index.mdx and update card links Co-Authored-By: jhaynie@agentuity.com --- content/docs/SDKs/python/index.mdx | 44 ++++++++++++++++++++++++++---- 1 file changed, 38 insertions(+), 6 deletions(-) diff --git a/content/docs/SDKs/python/index.mdx b/content/docs/SDKs/python/index.mdx index 94949a18..b112261f 100644 --- a/content/docs/SDKs/python/index.mdx +++ b/content/docs/SDKs/python/index.mdx @@ -7,6 +7,11 @@ description: Agentuity Python SDK Documentation The Agentuity Python SDK is a powerful toolkit for building, deploying, and managing AI agents in Python environments. This SDK provides developers with a comprehensive set of tools to create intelligent agents that can process various types of content, communicate with each other, and integrate with external systems. +## Prerequisites + +- [Python](https://www.python.org/) (3.10 or 3.11) +- [uv](https://docs.astral.sh/uv/) (latest version recommended) + ## Installation First, install the Agentuity CLI: @@ -21,16 +26,38 @@ Then create a new project: agentuity new ``` -This will set up a new project with the Python SDK already configured. +This will create a new project with a default `agentuity.yaml` configuration file and agent structure. + +## Creating Your First Agent + +Navigate to the agent file created by the CLI: + +```bash +cd agents/myfirstagent +``` + +Edit the `agent.py` file and add the following code: + +```python +from agentuity.server import AgentRequest, AgentResponse, AgentContext + +def run(request: AgentRequest, response: AgentResponse, context: AgentContext): + return response.text("Hello, world") +``` + +## Running Your Agent + +Start the local development server: + +```bash +agentuity dev +``` + +When the server starts, you'll see a local URL in the console output. Open this URL in your browser to access the Agentuity development UI, where you can test your agent and view the responses. ## Key Features
- -

Getting Started

-

Quick start guide for building your first agent

-
-

Async API

Work with fully asynchronous agents

@@ -45,4 +72,9 @@ This will set up a new project with the Python SDK already configured.

Data Handling

Work with various data types and streaming capabilities

+ + +

CrewAI

+

Build teams of AI agents with CrewAI integration

+
From 9b5fc1b50c53f752303724ac5fcdeba77051506d Mon Sep 17 00:00:00 2001 From: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> Date: Thu, 1 May 2025 03:09:54 +0000 Subject: [PATCH 7/9] Remove meta.json file as requested Co-Authored-By: jhaynie@agentuity.com --- content/docs/SDKs/python/meta.json | 3 --- 1 file changed, 3 deletions(-) delete mode 100644 content/docs/SDKs/python/meta.json diff --git a/content/docs/SDKs/python/meta.json b/content/docs/SDKs/python/meta.json deleted file mode 100644 index 792630f7..00000000 --- a/content/docs/SDKs/python/meta.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "title": "Python SDK" -} From 589bd2077bb5a3a05edeb71840895a787d5405c3 Mon Sep 17 00:00:00 2001 From: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> Date: Thu, 1 May 2025 03:11:03 +0000 Subject: [PATCH 8/9] Remove CrewAI card from index.mdx Co-Authored-By: jhaynie@agentuity.com --- content/docs/SDKs/python/crewai.mdx | 20 -------------------- content/docs/SDKs/python/index.mdx | 5 ----- 2 files changed, 25 deletions(-) delete mode 100644 content/docs/SDKs/python/crewai.mdx diff --git a/content/docs/SDKs/python/crewai.mdx b/content/docs/SDKs/python/crewai.mdx deleted file mode 100644 index dc889968..00000000 --- a/content/docs/SDKs/python/crewai.mdx +++ /dev/null @@ -1,20 +0,0 @@ ---- -title: CrewAI -description: Building AI agent teams with CrewAI and Agentuity ---- - -# CrewAI - -CrewAI is a framework for building teams of AI agents. When integrated with Agentuity, you can create powerful multi-agent systems that collaborate on complex tasks. - -## Installation - -```bash -pip install crewai -``` - -## Integration with Agentuity - -CrewAI can be integrated with Agentuity to leverage Agentuity's agent management and communication capabilities. - -For more details, see the [CrewAI documentation](https://docs.crewai.com/). diff --git a/content/docs/SDKs/python/index.mdx b/content/docs/SDKs/python/index.mdx index b112261f..d633a4bf 100644 --- a/content/docs/SDKs/python/index.mdx +++ b/content/docs/SDKs/python/index.mdx @@ -72,9 +72,4 @@ When the server starts, you'll see a local URL in the console output. Open this

Data Handling

Work with various data types and streaming capabilities

- - -

CrewAI

-

Build teams of AI agents with CrewAI integration

-
From 53ada84ededae7a253337e739ac0956d2618f131 Mon Sep 17 00:00:00 2001 From: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> Date: Thu, 1 May 2025 03:17:14 +0000 Subject: [PATCH 9/9] Update agent resolution API to use context.get_agent with dictionary parameters Co-Authored-By: jhaynie@agentuity.com --- content/docs/SDKs/python/agent-to-agent.mdx | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/content/docs/SDKs/python/agent-to-agent.mdx b/content/docs/SDKs/python/agent-to-agent.mdx index 339d3d74..7e531005 100644 --- a/content/docs/SDKs/python/agent-to-agent.mdx +++ b/content/docs/SDKs/python/agent-to-agent.mdx @@ -27,7 +27,7 @@ The SDK now supports communication with agents running in different environments ```python async def run(request, response, context): # Resolve an agent (local or remote) - agent = context.get_agent("remote_agent_id") + agent = context.get_agent({"id": "remote_agent_id"}) # Create data for the remote agent from agentuity.server.data import Data, StringStreamReader @@ -43,20 +43,18 @@ async def run(request, response, context): ## Agent Resolution -The `resolve_agent` function automatically determines whether to create a local or remote agent instance: +The `AgentContext` provides methods for resolving agents, whether they are local or remote: ```python -from agentuity.server.agent import resolve_agent - async def run(request, response, context): # Resolve by ID - agent = resolve_agent(context, "agent_id") + agent = context.get_agent({"id": "agent_id"}) # Resolve by name - agent = resolve_agent(context, {"name": "AgentName"}) + agent = context.get_agent({"name": "AgentName"}) # Resolve by name in a specific project - agent = resolve_agent(context, {"name": "AgentName", "projectId": "proj_123"}) + agent = context.get_agent({"name": "AgentName", "projectId": "proj_123"}) # Call the resolved agent result = await agent.run(request.data)