-
Notifications
You must be signed in to change notification settings - Fork 900
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(agents-api,integrations): Working integrations for tool-call step (
#521) - **fix(typespec,agents-api): Rename integration providers** - **feat(agents-api,integrations): Working integrations for tool-call step** <!-- ELLIPSIS_HIDDEN --> ---- > [!IMPORTANT] > Add integration service handling for tool-call steps in agents API, including provider renames and workflow updates. > > - **Integrations**: > - Implement `run_integration_service` in `clients/integrations.py` to handle integration service calls. > - Update `execute_integration` in `activities/execute_integration.py` to use `run_integration_service` for non-dummy providers. > - Add `INTEGRATION_SERVICE_URL` to `.env.example`, `env.py`, and `docker-compose.yml`. > - **Renames**: > - Rename integration providers in `Tools.py` and `scalars.tsp` (e.g., `dall-e` to `dalle_image_generator`). > - **Workflows**: > - Update `task_execution/__init__.py` to handle integration tool calls using `execute_integration`. > - **Tests**: > - Add `integration_example.yaml` for sample tasks. > - Add tests for integration tool calls in `test_execution_workflow.py`. > - Add `patch_integration_service` in `utils.py` for mocking integration service calls. > > <sup>This description was created by </sup>[<img alt="Ellipsis" src="https://img.shields.io/badge/Ellipsis-blue?color=175173">](https://www.ellipsis.dev?ref=julep-ai%2Fjulep&utm_source=github&utm_medium=referral)<sup> for f13f8dd. It will automatically update as commits are pushed.</sup> <!-- ELLIPSIS_HIDDEN --> --------- Signed-off-by: Diwank Singh Tomer <[email protected]>
- Loading branch information
Showing
12 changed files
with
192 additions
and
37 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
from typing import Any, List | ||
|
||
from beartype import beartype | ||
from httpx import AsyncClient | ||
|
||
from ..env import integration_service_url | ||
|
||
__all__: List[str] = ["run_integration_service"] | ||
|
||
|
||
@beartype | ||
async def run_integration_service( | ||
*, | ||
provider: str, | ||
arguments: dict, | ||
setup: dict | None = None, | ||
method: str | None = None, | ||
) -> Any: | ||
slug = f"{provider}/{method}" if method else provider | ||
url = f"{integration_service_url}/execute/{slug}" | ||
|
||
setup = setup or {} | ||
|
||
async with AsyncClient() as client: | ||
response = await client.post( | ||
url, | ||
json={"arguments": arguments, "setup": setup}, | ||
) | ||
response.raise_for_status() | ||
|
||
return response.json() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
agents-api/migrations/migrate_1727235852_add_forward_tool_calls_option.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
name: Simple multi step task | ||
|
||
input_schema: | ||
type: object | ||
properties: | ||
topics: | ||
type: array | ||
items: | ||
type: string | ||
|
||
tools: | ||
- type: function | ||
function: | ||
name: generate_questions | ||
description: Generate a list of questions for a given topic | ||
parameters: | ||
type: object | ||
properties: | ||
topic: | ||
type: string | ||
description: The topic to generate questions for | ||
|
||
- type: integration | ||
name: duckduckgo_search | ||
integration: | ||
provider: duckduckgo | ||
setup: | ||
api_key: <something> | ||
arguments: | ||
language: en-US | ||
|
||
main: | ||
- foreach: | ||
in: _["topics"] | ||
do: | ||
prompt: | ||
- role: system | ||
content: |- | ||
Generate a list of 10 questions for the topic {{_}} as valid yaml. | ||
unwrap: true | ||
|
||
- tool: duckduckgo_search | ||
arguments: | ||
query: "'\n'.join(_)" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters