-
Notifications
You must be signed in to change notification settings - Fork 917
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(integrations-service): Add new integrations & refactor integrations service #540
Merged
Merged
Changes from all commits
Commits
Show all changes
32 commits
Select commit
Hold shift + click to select a range
4ace5fa
fix: Remove unnecessary docker compose dependencies
d633c77
fix: Fix litellm config for voyage-3
creatorrr 50f96d3
Merge branch 'main' into dev
creatorrr ecc95ea
Implement ToolCallStep & Fix transition after PromptStep (#513)
HamadaSalhab 6896c23
doc: Update README.md with announcement update (#517)
creatorrr a4151d0
feat: Add basic support for integration tools to ToolStep (#519)
creatorrr d8072a0
feat(integration-service): Add integrations service (#520)
HamadaSalhab ed33cf9
feat(agents-api,integrations): Working integrations for tool-call ste…
creatorrr 833433a
fix(agents-api): Fix wait for input step (#522)
HamadaSalhab 087495b
feat(integration-service): template spider integration added
Vedantsahai18 683522c
feat(integration-service): template spider integration updated
Vedantsahai18 6c0a919
Remove disabled integrations
HamadaSalhab 9db28a6
feat(integrations-service): Refactor models
HamadaSalhab e345dfe
feat(agents-api): Add support for reading setup args from metadata an…
creatorrr 5060ee3
feat: Add docker bake builder (#528)
creatorrr de2be8b
fix: Minor fix to docker bake github actions (#529)
creatorrr cc8adca
feat: Add changelog from release notes (#530)
creatorrr be4d40f
Update changelog for v0.4.0 (#531)
github-actions[bot] 98d322b
fix: Bake on release as well (#532)
creatorrr 79a2114
feat(integrations-service): Refactor models & endpoints | Add spider …
HamadaSalhab 9f46e02
feat(integrations-service): Add get_integration endpoint
HamadaSalhab e9b7075
Merge branch 'dev' into f/integrations-improvement
HamadaSalhab b9c3c9e
feat(integrations-service): Update poetry.lock
HamadaSalhab 23f1964
fix(integrations-service): fix spider crawl output
HamadaSalhab d67c375
fix(agents-api): Set empty integration setup to None
HamadaSalhab a568f4b
feat(integrations-service): Add brave & browserbase integrations | Sw…
HamadaSalhab d977e98
Reformat
HamadaSalhab ff15631
feat(agents-api): Add new integrations to typespec & loosen integrati…
HamadaSalhab 53bb994
Merge branch 'dev' into f/integrations-improvement
HamadaSalhab aeb20a8
Fix(integrations-service): Add setuptools to fix weather integration
HamadaSalhab c1828e6
Fix(integrations-service): Change to asynchronous methods
HamadaSalhab a6f7e6a
Fix(agents-api): Remove duplicate fields in autogen
HamadaSalhab File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 |
---|---|---|
@@ -1,17 +1,18 @@ | ||
from .dalle_image_generator import ( | ||
DalleImageGeneratorArguments, | ||
DalleImageGeneratorSetup, | ||
from .base_models import ( | ||
BaseArguments, | ||
BaseOutput, | ||
BaseProvider, | ||
BaseProviderMethod, | ||
BaseSetup, | ||
ProviderInfo, | ||
) | ||
from .duckduckgo_search import DuckDuckGoSearchExecutionArguments | ||
from .hacker_news import HackerNewsExecutionArguments | ||
|
||
# TODO: Move these models somewhere else | ||
from .models import ( | ||
ExecuteIntegrationArguments, | ||
ExecuteIntegrationSetup, | ||
IntegrationDef, | ||
IntegrationExecutionRequest, | ||
IntegrationExecutionResponse, | ||
from .brave import BraveSearchArguments, BraveSearchOutput, BraveSearchSetup | ||
from .browserbase import ( | ||
BrowserBaseLoadArguments, | ||
BrowserBaseLoadOutput, | ||
BrowserBaseSetup, | ||
) | ||
from .weather import WeatherExecutionArguments, WeatherExecutionSetup | ||
from .wikipedia import WikipediaExecutionArguments | ||
from .hacker_news import HackerNewsFetchArguments, HackerNewsFetchOutput | ||
from .spider import SpiderFetchArguments, SpiderFetchOutput, SpiderSetup | ||
from .weather import WeatherGetArguments, WeatherGetOutput, WeatherSetup | ||
from .wikipedia import WikipediaSearchArguments, WikipediaSearchOutput |
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,36 @@ | ||
from typing import Annotated, Any, Optional | ||
|
||
from pydantic import BaseModel, Field, RootModel | ||
from pydantic_core import Url | ||
|
||
IdentifierName = Annotated[str, Field(max_length=40, pattern="^[^\\W0-9]\\w*$")] | ||
|
||
|
||
class BaseSetup(BaseModel): ... | ||
|
||
|
||
class BaseArguments(BaseModel): ... | ||
|
||
|
||
class BaseOutput(BaseModel): ... | ||
|
||
|
||
class ProviderInfo(BaseModel): | ||
url: Optional[Url] | ||
docs: Optional[Url] | ||
icon: Optional[Url] | ||
friendly_name: str | ||
|
||
|
||
class BaseProviderMethod(BaseModel): | ||
method: IdentifierName | ||
description: str | ||
arguments: type[BaseArguments] | ||
output: type[BaseOutput] | ||
|
||
|
||
class BaseProvider(BaseModel): | ||
provider: IdentifierName | ||
setup: type[BaseSetup] | None | ||
methods: list[BaseProviderMethod] | ||
info: ProviderInfo |
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,19 @@ | ||
from pydantic import Field | ||
|
||
from .base_models import ( | ||
BaseArguments, | ||
BaseOutput, | ||
BaseSetup, | ||
) | ||
|
||
|
||
class BraveSearchSetup(BaseSetup): | ||
api_key: str = Field(..., description="The api key for Brave Search") | ||
|
||
|
||
class BraveSearchArguments(BaseArguments): | ||
query: str = Field(..., description="The search query for searching with Brave") | ||
|
||
|
||
class BraveSearchOutput(BaseOutput): | ||
result: str = Field(..., description="The result of the Brave Search") |
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,29 @@ | ||
from typing import List, Optional | ||
|
||
from langchain_core.documents import Document | ||
from pydantic import Field | ||
from pydantic_core import Url | ||
|
||
from .base_models import ( | ||
BaseArguments, | ||
BaseOutput, | ||
BaseSetup, | ||
) | ||
|
||
|
||
class BrowserBaseSetup(BaseSetup): | ||
api_key: str = Field(..., description="The api key for BrowserBase") | ||
project_id: str = Field(..., description="The project id for BrowserBase") | ||
session_id: Optional[str] = Field( | ||
None, description="The session id for BrowserBase" | ||
) | ||
|
||
|
||
class BrowserBaseLoadArguments(BaseArguments): | ||
urls: List[Url] = Field(..., description="The urls for loading with BrowserBase") | ||
|
||
|
||
class BrowserBaseLoadOutput(BaseOutput): | ||
documents: List[Document] = Field( | ||
..., description="The documents loaded from the urls" | ||
) |
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,50 @@ | ||
from typing import Optional, Union | ||
|
||
from pydantic import BaseModel | ||
|
||
from .brave import BraveSearchArguments, BraveSearchOutput, BraveSearchSetup | ||
from .browserbase import ( | ||
BrowserBaseLoadArguments, | ||
BrowserBaseLoadOutput, | ||
BrowserBaseSetup, | ||
) | ||
from .hacker_news import HackerNewsFetchArguments, HackerNewsFetchOutput | ||
from .spider import SpiderFetchArguments, SpiderFetchOutput, SpiderSetup | ||
from .weather import WeatherGetArguments, WeatherGetOutput, WeatherSetup | ||
from .wikipedia import WikipediaSearchArguments, WikipediaSearchOutput | ||
|
||
ExecutionSetup = Union[ | ||
SpiderSetup, | ||
WeatherSetup, | ||
BraveSearchSetup, | ||
BrowserBaseSetup, | ||
] | ||
|
||
ExecutionArguments = Union[ | ||
SpiderFetchArguments, | ||
WeatherGetArguments, | ||
HackerNewsFetchArguments, | ||
WikipediaSearchArguments, | ||
BraveSearchArguments, | ||
BrowserBaseLoadArguments, | ||
] | ||
|
||
ExecutionResponse = Union[ | ||
SpiderFetchOutput, | ||
WeatherGetOutput, | ||
HackerNewsFetchOutput, | ||
WikipediaSearchOutput, | ||
BraveSearchOutput, | ||
BrowserBaseLoadOutput, | ||
] | ||
|
||
|
||
class ExecutionRequest(BaseModel): | ||
setup: Optional[ExecutionSetup] | ||
""" | ||
The setup parameters the integration accepts (such as API keys) | ||
""" | ||
arguments: ExecutionArguments | ||
""" | ||
The arguments to pass to the integration | ||
""" |
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 |
---|---|---|
@@ -1,5 +1,15 @@ | ||
from pydantic import BaseModel, Field | ||
from langchain_core.documents import Document | ||
from pydantic import Field | ||
from pydantic_core import Url | ||
|
||
from .base_models import BaseArguments, BaseOutput | ||
|
||
class HackerNewsExecutionArguments(BaseModel): | ||
url: str = Field(..., description="The URL of the Hacker News thread to fetch") | ||
|
||
class HackerNewsFetchArguments(BaseArguments): | ||
url: Url = Field(..., description="The URL of the Hacker News thread to fetch") | ||
|
||
|
||
class HackerNewsFetchOutput(BaseOutput): | ||
documents: list[Document] = Field( | ||
..., description="The documents returned from the Hacker News search" | ||
) |
Empty file.
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,21 @@ | ||
from langchain_core.documents import Document | ||
from pydantic import Field | ||
from pydantic_core import Url | ||
|
||
from .base_models import BaseArguments, BaseOutput, BaseSetup | ||
|
||
|
||
class SpiderSetup(BaseSetup): | ||
spider_api_key: str = Field(..., description="The request for which to fetch data") | ||
|
||
|
||
class SpiderFetchArguments(BaseArguments): | ||
url: Url = Field(..., description="The url for which to fetch data") | ||
mode: str = Field("scrape", description="The type of crawlers") | ||
params: dict | None = Field(None, description="The parameters for the Spider API") | ||
|
||
|
||
class SpiderFetchOutput(BaseOutput): | ||
documents: list[Document] = Field( | ||
..., description="The documents returned from the spider" | ||
) |
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 |
---|---|---|
@@ -1,13 +1,23 @@ | ||
from pydantic import BaseModel, Field | ||
from pydantic import Field | ||
|
||
from .base_models import ( | ||
BaseArguments, | ||
BaseOutput, | ||
BaseSetup, | ||
) | ||
|
||
class WeatherExecutionSetup(BaseModel): | ||
|
||
class WeatherSetup(BaseSetup): | ||
openweathermap_api_key: str = Field( | ||
..., description="The location for which to fetch weather data" | ||
..., description="The api key for OpenWeatherMap" | ||
) | ||
|
||
|
||
class WeatherExecutionArguments(BaseModel): | ||
class WeatherGetArguments(BaseArguments): | ||
location: str = Field( | ||
..., description="The location for which to fetch weather data" | ||
) | ||
|
||
|
||
class WeatherGetOutput(BaseOutput): | ||
result: str = Field(..., description="The weather data for the specified location") |
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 |
---|---|---|
@@ -1,6 +1,20 @@ | ||
from pydantic import BaseModel, Field | ||
from typing import Literal | ||
|
||
from langchain_core.documents import Document | ||
from pydantic import Field | ||
|
||
class WikipediaExecutionArguments(BaseModel): | ||
from .base_models import ( | ||
BaseArguments, | ||
BaseOutput, | ||
) | ||
|
||
|
||
class WikipediaSearchArguments(BaseArguments): | ||
query: str = Field(..., description="The search query string") | ||
load_max_docs: int = Field(2, description="Maximum number of documents to load") | ||
|
||
|
||
class WikipediaSearchOutput(BaseOutput): | ||
documents: list[Document] = Field( | ||
..., description="The documents returned from the Wikipedia search" | ||
) |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Redundant assignment:
setup = setup or None
is unnecessary sincesetup
is alreadyNone
by default. Remove this line to simplify the code.