Skip to content

Commit

Permalink
feat: Deprecate OpenAIToolsAgent in favour of ToolsAgent (#532)
Browse files Browse the repository at this point in the history
  • Loading branch information
davidmigloz authored Aug 21, 2024
1 parent f3ee5b4 commit 68d8011
Show file tree
Hide file tree
Showing 20 changed files with 55 additions and 346 deletions.
1 change: 0 additions & 1 deletion docs/_sidebar.md
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,6 @@
- [Agents](/modules/agents/agents.md)
- [Agent types](/modules/agents/agent_types/agent_types.md)
- [Tools Agent](/modules/agents/agent_types/tools_agent.md)
- [OpenAI Tools Agent](/modules/agents/agent_types/openai_tools_agent.md)
- [Tools](/modules/agents/tools/tools.md)
- [Calculator](/modules/agents/tools/calculator.md)
- [DALL-E Image Generator](/modules/agents/tools/openai_dall_e.md)
Expand Down
173 changes: 0 additions & 173 deletions docs/modules/agents/agent_types/openai_tools_agent.md

This file was deleted.

4 changes: 2 additions & 2 deletions docs/modules/agents/agents.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ First, let's load the language model we're going to use to control the agent.
```dart
final llm = ChatOpenAI(
apiKey: openAiKey,
defaultOptions: const ChatOpenAIOptions(temperature: 0),
defaultOptions: ChatOpenAIOptions(temperature: 0),
);
```

Expand All @@ -91,7 +91,7 @@ Finally, let's initialize an agent with the tools, the language model, and the
type of agent we want to use.

```dart
final agent = OpenAIToolsAgent.fromLLMAndTools(llm: llm, tools: tools);
final agent = ToolsAgent.fromLLMAndTools(llm: llm, tools: tools);
```

Now let's create the agent executor and test it out!
Expand Down
2 changes: 1 addition & 1 deletion docs/modules/agents/tools/calculator.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ final llm = ChatOpenAI(
),
);
final tool = CalculatorTool();
final agent = OpenAIToolsAgent.fromLLMAndTools(llm: llm, tools: [tool]);
final agent = ToolsAgent.fromLLMAndTools(llm: llm, tools: [tool]);
final executor = AgentExecutor(agent: agent);
final res = await executor.run('What is 40 raised to the 0.43 power? ');
print(res); // -> '40 raised to the power of 0.43 is approximately 4.8852'
Expand Down
2 changes: 1 addition & 1 deletion docs/modules/agents/tools/openai_dall_e.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ final tools = <Tool>[
CalculatorTool(),
OpenAIDallETool(apiKey: openAiKey),
];
final agent = OpenAIToolsAgent.fromLLMAndTools(llm: llm, tools: tools);
final agent = ToolsAgent.fromLLMAndTools(llm: llm, tools: tools);
final executor = AgentExecutor(agent: agent);
final res = await executor.run(
'Calculate the result of 40 raised to the power of 0.43 and generate a funny illustration with it. '
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ void main() async {
),
);
final tool = CalculatorTool();
final agent = OpenAIToolsAgent.fromLLMAndTools(llm: llm, tools: [tool]);
final agent = ToolsAgent.fromLLMAndTools(llm: llm, tools: [tool]);
final executor = AgentExecutor(agent: agent);
final res = await executor.run('What is 40 raised to the 0.43 power? ');
print(res); // -> '40 raised to the power of 0.43 is approximately 4.8852'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ void main() async {
CalculatorTool(),
OpenAIDallETool(apiKey: openAiKey),
];
final agent = OpenAIToolsAgent.fromLLMAndTools(llm: llm, tools: tools);
final agent = ToolsAgent.fromLLMAndTools(llm: llm, tools: tools);
final executor = AgentExecutor(agent: agent);
final res = await executor.run(
'Calculate the result of 40 raised to the power of 0.43 and generate a funny illustration with it. '
Expand Down
Loading

0 comments on commit 68d8011

Please sign in to comment.