-
Notifications
You must be signed in to change notification settings - Fork 917
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
Signed-off-by: Diwank Singh Tomer <diwank.singh@gmail.com>
- Loading branch information
Showing
8 changed files
with
135 additions
and
18 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
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
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