openai

package
v1.3.1 Latest Latest
Warning

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

Go to latest
Published: Mar 11, 2025 License: AGPL-3.0, Apache-2.0, MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	EndpointChat            = "/openai/v1/chat/completions"
	EndpointChatCompletions = "/v1/chat/completions"
	EndpointEmbeddings      = "/openai/v1/embeddings"
)

Variables

This section is empty.

Functions

func FromChatCompletionResponse

func FromChatCompletionResponse(in openai.ChatCompletion) ollamaapi.ChatResponse

func FromErrorResponse

func FromErrorResponse(statusCode int) func(response openai.ErrorResponse) ollamaapi.StatusError

Types

type ChatCompletionRequest

type ChatCompletionRequest struct {
	openai.ChatCompletionRequest `json:",inline"`
}

func ToChatCompletionRequest

func ToChatCompletionRequest(in ollamaapi.ChatRequest) ChatCompletionRequest

func (ChatCompletionRequest) MarshalJSON

func (in ChatCompletionRequest) MarshalJSON() ([]byte, error)

type Endpoint

type Endpoint string

type Message

type Message struct {
	openai.Message `json:",inline"`
}

func (Message) MarshalJSON

func (in Message) MarshalJSON() ([]byte, error)

Jump to

Keyboard shortcuts

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