-
Notifications
You must be signed in to change notification settings - Fork 55
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Feat add tools (#201) * fix: openai WithTools pointer receiver (#204) * fix: use pointer receiver * chore: add assistant execute * chore: change the way assistant actually works * chore: rename tools in tool * docs: update docs * Refactor ssistant observer (#206) * refactor assistant observer * fix: linting * fix: assistant observer * fix: linting * fix: serpapi response parsing * fix: tools * fix: use json as default output and parse embeddings * fix * fix ollama embed error * fix lint
- Loading branch information
Showing
43 changed files
with
1,502 additions
and
61 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,4 +19,5 @@ bin/ | |
llama.cpp/ | ||
whisper.cpp/ | ||
|
||
*/.hugo_build.lock | ||
*/.hugo_build.lock | ||
docs/public/ |
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
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,52 @@ | ||
--- | ||
title: "Performing tasks with Tools" | ||
description: | ||
linkTitle: "Tool" | ||
menu: { main: { parent: 'reference', weight: -89 } } | ||
--- | ||
|
||
Tools are components that can be used to perform specific tasks. They can be used to automate, answer questions, and provide information. LinGoose offers a variety of tools that can be used to perform different actions. | ||
|
||
## Available Tools | ||
|
||
- *Python*: It can be used to run Python code and get the output. | ||
- *SerpApi*: It can be used to get search results from Google and other search engines. | ||
- *Dall-e*: It can be used to generate images based on text descriptions. | ||
- *DuckDuckGo*: It can be used to get search results from DuckDuckGo. | ||
- *RAG*: It can be used to retrieve relevant documents based on a query. | ||
- *LLM*: It can be used to generate text based on a prompt. | ||
- *Shell*: It can be used to run shell commands and get the output. | ||
|
||
|
||
## Using Tools | ||
|
||
LinGoose tools can be used to perform specific tasks. Here is an example of using the `Python` and `serpapi` tools to get information and run Python code and get the output. | ||
|
||
```go | ||
auto := "auto" | ||
myAgent := assistant.New( | ||
openai.New().WithModel(openai.GPT4o).WithToolChoice(&auto).WithTools( | ||
pythontool.New(), | ||
serpapitool.New(), | ||
), | ||
).WithParameters( | ||
assistant.Parameters{ | ||
AssistantName: "AI Assistant", | ||
AssistantIdentity: "an helpful assistant", | ||
AssistantScope: "with their questions.", | ||
CompanyName: "", | ||
CompanyDescription: "", | ||
}, | ||
).WithThread( | ||
thread.New().AddMessages( | ||
thread.NewUserMessage().AddContent( | ||
thread.NewTextContent("calculate the average temperature in celsius degrees of New York, Rome, and Tokyo."), | ||
), | ||
), | ||
).WithMaxIterations(10) | ||
|
||
err := myAgent.Run(context.Background()) | ||
if err != nil { | ||
panic(err) | ||
} | ||
``` |
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
Oops, something went wrong.