Skip to content
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

Clarify adding new agents to the container_factory #24

Merged
merged 1 commit into from
Jan 28, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 21 additions & 1 deletion add_new_agent.md
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,27 @@ class ToolProvider:
```
Match the name here with the name defined in your AI Agent class

### Step 5: Add your agent to the configuration for task models
### Step 5: Register your agent in the container_factory
Add your new AI Agent to the container_factory.py file in the same directory: `language_model_gateway/container/container_factory.py`. This is where the LLM will look for all available AI Agents.

```python
container.register(
JiraIssueHelper,
lambda c: JiraIssueHelper(
http_client_factory=c.resolve(HttpClientFactory),
jira_base_url=c.resolve(EnvironmentVariables).jira_base_url,
access_token=c.resolve(EnvironmentVariables).jira_token,
username=c.resolve(EnvironmentVariables).jira_username,
),
)
```
You may also need to register any dependencies that your AI Agent needs to the container_factory.py file. For example, the JiraIssueHelper needs a HttpClientFactory class to do the actual work.
```python
container.register(HttpClientFactory, lambda c: HttpClientFactory())
```


### Step 6: Add your agent to the configuration for task models
You can now add this to any task model configurations where you want this tool available: `language_model_gateway/configs/chat_completions/testing`

```json
Expand Down
Loading