ollama

package
v0.0.0-...-b43dce5 Latest Latest
Warning

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

Go to latest
Published: Nov 8, 2024 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Overview

Package ollama provies handlers that proxies ollama API calls to Gemini models.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RegisterHandlers

func RegisterHandlers(r *mux.Router, client *genai.Client)

Types

type EmbedRequest

type EmbedRequest struct {
	Model string   `json:"model,omitempty"`
	Input []string `json:"input,omitempty"`
}

type EmbedResponse

type EmbedResponse struct {
	Model      string      `json:"model,omitempty"`
	Embeddings [][]float32 `json:"embeddings,omitempty"`
}

type GenerateRequest

type GenerateRequest struct {
	Model   string  `json:"model,omitempty"`
	Prompt  string  `json:"prompt,omitempty"`
	Suffix  string  `json:"suffix,omitempty"`
	Options Options `json:"options,omitempty"`
	System  string  `json:"system,omitempty"`
}

type GenerateResponse

type GenerateResponse struct {
	Model     string    `json:"model,omitempty"`
	Response  string    `json:"response,omitempty"`
	CreatedAt time.Time `json:"created_at,omitempty"`

	PromptEvalCount int32 `json:"prompt_eval_count,omitempty"`
	EvalCount       int32 `json:"eval_count,omitempty"`

	Done bool `json:"done,omitempty"`
}

type Options

type Options struct {
	Temperature *float32 `json:"temperature,omitempty"`
	Stop        *string  `json:"stop,omitempty"`
	NumPredict  *int32   `json:"num_predict,omitempty"`
	TopK        *int32   `json:"top_k,omitempty"`
	TopP        *float32 `json:"top_p,omitempty"`
}

Jump to

Keyboard shortcuts

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