Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/dariubs/goAI
/ functions
Functions
50 in github.com/dariubs/goAI
⨍
Functions
50
◇
Types & classes
14
↓ 7 callers
Function
register
register registers a provider factory
client.go:46
↓ 1 callers
Method
chat
chat sends a prompt to the LLM and returns the response
client.go:28
↓ 1 callers
Function
defaultOptions
defaultOptions returns default options
options.go:20
Method
Chat
Chat sends a prompt to the LLM and returns the response The context can be used to set timeouts or cancel the request. Example: ctx, cancel := conte
client.go:98
Method
Error
Error implements the error interface
errors.go:17
Function
ListProviders
ListProviders returns a list of all registered provider names
client.go:107
Function
New
New creates a new LLM client Example: client := goai.New("openai", "gpt-4o", goai.WithAPIKey(os.Getenv("OPENAI_API_KEY")), )
client.go:58
Method
Unwrap
Unwrap returns the underlying error
errors.go:25
Function
WithAPIKey
WithAPIKey sets the API key for the provider Example: client := goai.New("openai", "gpt-4o", goai.WithAPIKey(os.Getenv("OPENAI_API_KEY")), )
options.go:34
Function
WithEndpoint
WithEndpoint sets a custom API endpoint Example: client := goai.New("openai", "gpt-4o", goai.WithAPIKey(apiKey), goai.WithEndpoint("https://api.opena
options.go:47
Function
WithMaxTokens
WithMaxTokens sets the maximum number of tokens in the response Example: client := goai.New("openai", "gpt-4o", goai.WithAPIKey(apiKey), goai.WithMax
options.go:73
Function
WithTemperature
WithTemperature sets the temperature for response generation Temperature controls randomness: 0.0 is deterministic, higher values are more random. E
options.go:88
Function
WithTimeout
WithTimeout sets the timeout for API requests Example: client := goai.New("openai", "gpt-4o", goai.WithAPIKey(apiKey), goai.WithTimeout(30*time.Secon
options.go:60
Method
chat
chat sends a prompt to Mistral and returns the response
mistral.go:43
Method
chat
chat sends a prompt to Perplexity and returns the response
perplexity.go:43
Method
chat
chat sends a prompt to Ollama and returns the response
ollama.go:41
Method
chat
chat sends a prompt to Anthropic and returns the response
anthropic.go:43
Method
chat
chat sends a prompt to xAI and returns the response
xai.go:43
Method
chat
chat sends a prompt to Google Gemini and returns the response
google.go:44
Method
chat
chat sends a prompt to OpenAI and returns the response
openai.go:43
Function
init
()
mistral.go:13
Function
init
()
perplexity.go:13
Function
init
()
ollama.go:13
Function
init
()
anthropic.go:13
Function
init
()
xai.go:13
Function
init
()
google.go:13
Function
init
()
openai.go:13
Method
model
model returns the model identifier
mistral.go:147
Method
model
model returns the model identifier
perplexity.go:147
Method
model
model returns the model identifier
ollama.go:143
Method
model
model returns the model identifier
anthropic.go:146
Method
model
model returns the model identifier
xai.go:147
Method
model
model returns the model identifier
google.go:154
Method
model
model returns the model identifier
client.go:34
Method
model
model returns the model identifier
openai.go:147
Method
name
name returns the provider name
mistral.go:142
Method
name
name returns the provider name
perplexity.go:142
Method
name
name returns the provider name
ollama.go:138
Method
name
name returns the provider name
anthropic.go:141
Method
name
name returns the provider name
xai.go:142
Method
name
name returns the provider name
google.go:149
Method
name
name returns the provider name
client.go:31
Method
name
name returns the provider name
openai.go:142
Function
newAnthropicProvider
newAnthropicProvider creates a new Anthropic provider
anthropic.go:25
Function
newGoogleProvider
newGoogleProvider creates a new Google provider
google.go:25
Function
newMistralProvider
newMistralProvider creates a new Mistral provider
mistral.go:25
Function
newOllamaProvider
newOllamaProvider creates a new Ollama provider
ollama.go:24
Function
newOpenAIProvider
newOpenAIProvider creates a new OpenAI provider
openai.go:25
Function
newPerplexityProvider
newPerplexityProvider creates a new Perplexity provider
perplexity.go:25
Function
newXAIProvider
newXAIProvider creates a new xAI provider
xai.go:25