Skip to content

Commit

Permalink
Remove dropdowns
Browse files Browse the repository at this point in the history
  • Loading branch information
hinthornw committed Sep 19, 2024
1 parent b66d0b2 commit 762ae54
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 89 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
__pycache__/
*.py[cod]
*$py.class
uv.lock

# C extensions
*.so
Expand Down
96 changes: 9 additions & 87 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,17 +40,17 @@ The primary [search tool](./src/react_agent/tools.py) [^1] used is [Tavily](http
Setup instruction auto-generated by `langgraph template lock`. DO NOT EDIT MANUALLY.
-->

<details>
<summary>Setup for `model_name`</summary>
The `llm` configuration defaults are shown below:
### Setup Model

The defaults values for `model` are shown below:

```yaml
model_name: anthropic/claude-3-5-sonnet-20240620
model: anthropic/claude-3-5-sonnet-20240620
```
Follow the instructions below to get set up, or pick one of the additional options.
### Anthropic Chat Models
#### Anthropic
To use Anthropic's chat models:
Expand All @@ -60,17 +60,7 @@ To use Anthropic's chat models:
```
ANTHROPIC_API_KEY=your-api-key
```
### Fireworks Chat Models
To use Fireworks AI's chat models:
1. Sign up for a [Fireworks AI account](https://app.fireworks.ai/signup) and obtain an API key.
2. Add your Fireworks AI API key to your `.env` file:
```
FIREWORKS_API_KEY=your-api-key
```
#### OpenAI Chat Models
#### OpenAI
To use OpenAI's chat models:
Expand All @@ -80,7 +70,7 @@ To use OpenAI's chat models:
OPENAI_API_KEY=your-api-key
```
</details>
Expand All @@ -96,7 +86,7 @@ End setup instructions
1. **Add new tools**: Extend the agent's capabilities by adding new tools in [tools.py](./src/react_agent/tools.py). These can be any Python functions that perform specific tasks.
2. **Select a different model**: We default to Anthropic's Claude 3 Sonnet. You can select a compatible chat model using `provider/model-name` via configuration. Example: `openai/gpt-4-turbo-preview`.
3. **Customize the prompt**: We provide a default system prompt in [configuration.py](./src/react_agent/configuration.py). You can easily update this via configuration in the studio.
3. **Customize the prompt**: We provide a default system prompt in [prompts.py](./src/react_agent/prompts.py). You can easily update this via configuration in the studio.
You can also quickly extend this template by:
Expand All @@ -122,7 +112,7 @@ Configuration auto-generated by `langgraph template lock`. DO NOT EDIT MANUALLY.
"agent": {
"type": "object",
"properties": {
"model_name": {
"model": {
"type": "string",
"default": "anthropic/claude-3-5-sonnet-20240620",
"description": "The name of the language model to use for the agent's main interactions. Should be in the form: provider/model-name.",
Expand Down Expand Up @@ -159,74 +149,6 @@ Configuration auto-generated by `langgraph template lock`. DO NOT EDIT MANUALLY.
"value": "anthropic/claude-instant-1.2",
"variables": "ANTHROPIC_API_KEY"
},
{
"value": "fireworks/gemma2-9b-it",
"variables": "FIREWORKS_API_KEY"
},
{
"value": "fireworks/llama-v3-70b-instruct",
"variables": "FIREWORKS_API_KEY"
},
{
"value": "fireworks/llama-v3-70b-instruct-hf",
"variables": "FIREWORKS_API_KEY"
},
{
"value": "fireworks/llama-v3-8b-instruct",
"variables": "FIREWORKS_API_KEY"
},
{
"value": "fireworks/llama-v3-8b-instruct-hf",
"variables": "FIREWORKS_API_KEY"
},
{
"value": "fireworks/llama-v3p1-405b-instruct",
"variables": "FIREWORKS_API_KEY"
},
{
"value": "fireworks/llama-v3p1-405b-instruct-long",
"variables": "FIREWORKS_API_KEY"
},
{
"value": "fireworks/llama-v3p1-70b-instruct",
"variables": "FIREWORKS_API_KEY"
},
{
"value": "fireworks/llama-v3p1-8b-instruct",
"variables": "FIREWORKS_API_KEY"
},
{
"value": "fireworks/mixtral-8x22b-instruct",
"variables": "FIREWORKS_API_KEY"
},
{
"value": "fireworks/mixtral-8x7b-instruct",
"variables": "FIREWORKS_API_KEY"
},
{
"value": "fireworks/mixtral-8x7b-instruct-hf",
"variables": "FIREWORKS_API_KEY"
},
{
"value": "fireworks/mythomax-l2-13b",
"variables": "FIREWORKS_API_KEY"
},
{
"value": "fireworks/phi-3-vision-128k-instruct",
"variables": "FIREWORKS_API_KEY"
},
{
"value": "fireworks/phi-3p5-vision-instruct",
"variables": "FIREWORKS_API_KEY"
},
{
"value": "fireworks/starcoder-16b",
"variables": "FIREWORKS_API_KEY"
},
{
"value": "fireworks/yi-large",
"variables": "FIREWORKS_API_KEY"
},
{
"value": "openai/gpt-3.5-turbo",
"variables": "OPENAI_API_KEY"
Expand Down
2 changes: 1 addition & 1 deletion src/react_agent/configuration.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ class Configuration:
},
)

model_name: Annotated[str, {"__template_metadata__": {"kind": "llm"}}] = field(
model: Annotated[str, {"__template_metadata__": {"kind": "llm"}}] = field(
default="anthropic/claude-3-5-sonnet-20240620",
metadata={
"description": "The name of the language model to use for the agent's main interactions. "
Expand Down
2 changes: 1 addition & 1 deletion src/react_agent/graph.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ async def call_model(
)

# Initialize the model with tool binding. Change the model or add more tools here.
model = load_chat_model(configuration.model_name).bind_tools(TOOLS)
model = load_chat_model(configuration.model).bind_tools(TOOLS)

# Prepare the input for the model, including the current system time
message_value = await prompt.ainvoke(
Expand Down

0 comments on commit 762ae54

Please sign in to comment.