ollama

package
v0.7.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 25, 2025 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type OllamaMessage

type OllamaMessage struct {
	Message    api.Message
	ToolCallID string // Store tool call ID separately since Ollama API doesn't have this field
}

OllamaMessage adapts Ollama's message format to our Message interface

func (*OllamaMessage) GetContent

func (m *OllamaMessage) GetContent() string

func (*OllamaMessage) GetRole

func (m *OllamaMessage) GetRole() string

func (*OllamaMessage) GetToolCalls

func (m *OllamaMessage) GetToolCalls() []llm.ToolCall

func (*OllamaMessage) GetToolResponseID

func (m *OllamaMessage) GetToolResponseID() string

func (*OllamaMessage) GetUsage

func (m *OllamaMessage) GetUsage() (int, int)

func (*OllamaMessage) IsToolResponse

func (m *OllamaMessage) IsToolResponse() bool

type OllamaToolCall

type OllamaToolCall struct {
	// contains filtered or unexported fields
}

OllamaToolCall adapts Ollama's tool call format

func NewOllamaToolCall

func NewOllamaToolCall(call api.ToolCall) *OllamaToolCall

func (*OllamaToolCall) GetArguments

func (t *OllamaToolCall) GetArguments() map[string]interface{}

func (*OllamaToolCall) GetID

func (t *OllamaToolCall) GetID() string

func (*OllamaToolCall) GetName

func (t *OllamaToolCall) GetName() string

type Provider

type Provider struct {
	// contains filtered or unexported fields
}

Provider implements the Provider interface for Ollama

func NewProvider

func NewProvider(model string, systemPrompt string) (*Provider, error)

NewProvider creates a new Ollama provider

func (*Provider) CreateMessage

func (p *Provider) CreateMessage(
	ctx context.Context,
	prompt string,
	messages []llm.Message,
	tools []llm.Tool,
) (llm.Message, error)

func (*Provider) CreateToolResponse

func (p *Provider) CreateToolResponse(
	toolCallID string,
	content interface{},
) (llm.Message, error)

func (*Provider) Name

func (p *Provider) Name() string

func (*Provider) SupportsTools

func (p *Provider) SupportsTools() bool

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL