WeaviateEx.Generative.Config (WeaviateEx v0.7.4)
View SourceTyped configuration structs for each generative AI provider.
Each provider has its own struct with provider-specific parameters. Use the factory functions to create configurations:
Examples
# OpenAI with all options
config = Config.openai(
model: "gpt-4",
temperature: 0.7,
max_tokens: 500,
frequency_penalty: 0.5
)
# Azure OpenAI
config = Config.azure_openai(
model: "gpt-4",
deployment_id: "my-deployment",
resource_name: "my-resource"
)
# Anthropic Claude
config = Config.anthropic(
model: "claude-3-5-sonnet-20241022",
max_tokens: 1000,
top_k: 40
)
# Use with generative query
Generative.single_prompt(client, "Article", "Summarize {title}",
provider_config: config
)
Summary
Functions
Create Anthropic configuration
Create Anyscale configuration
Create AWS Bedrock configuration
Create AWS SageMaker configuration
Create Azure OpenAI configuration
Create Cohere configuration
Create ContextualAI configuration
Create Databricks configuration
Create FriendliAI configuration
Create Google Gemini configuration
Create Google Vertex AI configuration
Create Mistral configuration
Create NVIDIA configuration
Create Ollama configuration
Create OpenAI configuration
Get provider name from config struct
Convert config to GraphQL parameters map
Create XAI (Grok) configuration
Types
@type config() :: WeaviateEx.Generative.Config.OpenAI.t() | WeaviateEx.Generative.Config.Anthropic.t() | WeaviateEx.Generative.Config.Cohere.t() | WeaviateEx.Generative.Config.AWS.t() | WeaviateEx.Generative.Config.Google.t() | WeaviateEx.Generative.Config.Mistral.t() | WeaviateEx.Generative.Config.Ollama.t() | WeaviateEx.Generative.Config.XAI.t() | WeaviateEx.Generative.Config.ContextualAI.t() | WeaviateEx.Generative.Config.Nvidia.t() | WeaviateEx.Generative.Config.Databricks.t() | WeaviateEx.Generative.Config.FriendliAI.t() | WeaviateEx.Generative.Config.Anyscale.t()
Functions
@spec anthropic(keyword()) :: WeaviateEx.Generative.Config.Anthropic.t()
Create Anthropic configuration
@spec anyscale(keyword()) :: WeaviateEx.Generative.Config.Anyscale.t()
Create Anyscale configuration
@spec aws_bedrock(keyword()) :: WeaviateEx.Generative.Config.AWS.t()
Create AWS Bedrock configuration
@spec aws_sagemaker(keyword()) :: WeaviateEx.Generative.Config.AWS.t()
Create AWS SageMaker configuration
@spec azure_openai(keyword()) :: WeaviateEx.Generative.Config.OpenAI.t()
Create Azure OpenAI configuration
@spec cohere(keyword()) :: WeaviateEx.Generative.Config.Cohere.t()
Create Cohere configuration
@spec contextualai(keyword()) :: WeaviateEx.Generative.Config.ContextualAI.t()
Create ContextualAI configuration
@spec databricks(keyword()) :: WeaviateEx.Generative.Config.Databricks.t()
Create Databricks configuration
@spec friendliai(keyword()) :: WeaviateEx.Generative.Config.FriendliAI.t()
Create FriendliAI configuration
@spec google_gemini(keyword()) :: WeaviateEx.Generative.Config.Google.t()
Create Google Gemini configuration
@spec google_vertex(keyword()) :: WeaviateEx.Generative.Config.Google.t()
Create Google Vertex AI configuration
@spec mistral(keyword()) :: WeaviateEx.Generative.Config.Mistral.t()
Create Mistral configuration
@spec nvidia(keyword()) :: WeaviateEx.Generative.Config.Nvidia.t()
Create NVIDIA configuration
@spec ollama(keyword()) :: WeaviateEx.Generative.Config.Ollama.t()
Create Ollama configuration
@spec openai(keyword()) :: WeaviateEx.Generative.Config.OpenAI.t()
Create OpenAI configuration
Get provider name from config struct
Convert config to GraphQL parameters map
@spec xai(keyword()) :: WeaviateEx.Generative.Config.XAI.t()
Create XAI (Grok) configuration