# Functions
DefineEmbedder registers the given embed function as an action, and returns an [Embedder] that runs it.
DefineIndexer registers the given index function as an action, and returns an [Indexer] that runs it.
DefineModel registers the given generate function as an action, and returns a [Model] that runs it.
DefinePrompt takes a function that renders a prompt template into a [GenerateRequest] that may be passed to a [Model].
DefineRetriever registers the given retrieve function as an action, and returns a [Retriever] that runs it.
DefineTool defines a tool function.
DocumentFromText returns a [Document] containing a single plain text part.
Embed invokes the embedder with provided options.
Generate run generate request for this model.
Generate run generate request for this model.
GenerateText run generate request for this model.
Index calls the retrivers with provided options.
IsDefinedEmbedder reports whether an embedder is defined.
IsDefinedIndexer reports whether an [Indexer] is defined.
IsDefinedModel reports whether a model is defined.
IsDefinedPrompt reports whether a [Prompt] is defined.
IsDefinedRetriever reports whether a [Retriever] is defined.
LookupEmbedder looks up an [Embedder] registered by [DefineEmbedder].
LookupIndexer looks up an [Indexer] registered by [DefineIndexer].
LookupModel looks up a [Model] registered by [DefineModel].
LookupPrompt looks up a [Prompt] registered by [DefinePrompt].
LookupRetriever looks up a [Retriever] registered by [DefineRetriever].
LookupTool looks up the tool in the registry by provided name and returns it.
NewDataPart returns a Part containing raw string data.
NewGenerateRequest create a new GenerateRequest with provided config and messages.
NewJSONPart returns a Part containing JSON.
NewMediaPart returns a Part containing structured data described by the given mimeType.
NewMessage creates a new Message with the provided role, metadata and parts.
NewModelMessage creates a new Message with role "model" and provided parts.
NewUserTextMessage creates a new Message with role "model" and content with a single text part with the content of provided text.
NewSystemMessage creates a new Message with role "system" and provided parts.
NewUserTextMessage creates a new Message with role "system" and content with a single text part with the content of provided text.
NewTextMessage creates a new Message with the provided role and content with a single part containint provided text.
NewTextPart returns a Part containing text.
NewToolRequestPart returns a Part containing a request from the model to the client to run a Tool.
NewToolResponsePart returns a Part containing the results of applying a Tool that the model requested.
NewUserMessage creates a new Message with role "user" and provided parts.
NewUserTextMessage creates a new Message with role "user" and content with a single text part with the content of provided text.
Retrieve calls the retrivers with provided options.
WithCandidates adds provided candidate count to GenerateRequest.
WithConfig adds provided config to GenerateRequest.
WithContext adds provided context to GenerateRequest.
WithEmbedDocs adds documents to [EmbedRequest].
WithEmbedOptions set embedder options on [EmbedRequest].
WithEmbedText adds simple text documents to [EmbedRequest].
WithHistory adds provided history messages to the begining of GenerateRequest.Messages.
WithIndexerDoc adds a document to IndexRequest.
WithIndexerOpts sets indexer options on IndexRequest.
WithMessages adds provided messages to GenerateRequest.
WithOutputFormat adds provided output format to GenerateRequest.
WithOutputSchema adds provided output schema to GenerateRequest.
WithRetrieverDoc adds a document to RetrieveRequest.
WithRetrieverOpts retriever options to RetrieveRequest.
WithRetrieverText adds a simple text as document to RetrieveRequest.
WithStreaming adds a streaming callback to the generate request.
WithSystemPrompt adds a simple text system prompt as the first message in GenerateRequest.
WithTextPrompt adds a simple text user prompt to GenerateRequest.
WithTools adds provided tools to GenerateRequest.
# Constants
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
RoleModel indicates this message was generated by the model during a previous interaction.
RoleSystem indicates this message is user-independent context.
RoleTool indicates this message was generated by a local tool, likely triggered by a request from the model in one of its previous responses.
RoleUser indicates this message was generated by the client.
# Structs
A Candidate is one of several possible generated responses from a generation request.
A Document is a piece of data that can be embedded, indexed, or retrieved.
DocumentEmbedding holds emdedding information about a single document.
EmbedRequest is the data we pass to convert one or more documents to a multidimensional vector.
No description provided by the author
A GenerateRequest is a request to generate completions from a model.
GenerateRequestOutput describes the structure that the model's output should conform to.
A GenerateResponse is a model's response to a [GenerateRequest].
A GenerateResponseChunk is the portion of the [GenerateResponse] that is passed to a streaming callback.
GenerationCommonConfig holds configuration for generation.
GenerationUsage provides information about the generation process.
IndexerRequest is the data we pass to add documents to the database.
Message is the contents of a model response.
ModelCapabilities describes various capabilities of the model.
No description provided by the author
No description provided by the author
ModelMetadata is the metadata of the model, specifying things like nice user-visible label, capabilities, etc.
A Part is one part of a [Document].
RetrieverRequest is the data we pass to retrieve documents from the database.
RetrieverResponse is the response to a document lookup.
A ToolDef is an implementation of a single tool.
A ToolDefinition describes a tool.
A ToolRequest is a message from the model to the client that it should run a specific tool and pass a [ToolResponse] to the model on the next chat request it makes.
A ToolResponse is a message from the client to the model containing the results of running a specific tool on the arguments passed to the client by the model in a [ToolRequest].
# Type aliases
EmbedOption configures params of the Embed call.
FinishReason is the reason why a model stopped generating tokens.
GenerateOption configures params of the Generate call.
IndexerOption configures params of the Index call.
ModelStreamingCallback is the type for the streaming callback of a model.
OutputFormat is the format that the model's output should produce.
No description provided by the author
RetrieveOption configures params of the Retrieve call.
Role indicates which entity is responsible for the content of a message.