types

package
v0.0.6 Latest Latest
Warning

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

Go to latest
Published: Nov 12, 2024 License: GPL-3.0 Imports: 0 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ChatArgs

type ChatArgs struct {
	Model       string      `json:"model"`
	Messages    []Message   `json:"messages"`
	MaxTokens   int         `json:"max_tokens"`
	Temperature float64     `json:"temperature"`
	TopP        float64     `json:"top_p"`
	Seed        int         `json:"seed,omitempty"`
	Stream      bool        `json:"stream,omitempty"`
	Stop        interface{} `json:"stop"`
}

type ChatCompletionChunkResponse

type ChatCompletionChunkResponse struct {
	ID                string                              `json:"id"`
	Object            string                              `json:"object"`
	Created           int64                               `json:"created"`
	Model             string                              `json:"model"`
	SystemFingerprint string                              `json:"system_fingerprint"`
	Choices           []ChatCompletionChunkResponseChoice `json:"choices"`
	XGroq             struct {
		ID    string                           `json:"id"`
		Usage ChatCompletionChunkResponseUsage `json:"usage,omitempty"`
	} `json:"x_groq"`
}

type ChatCompletionChunkResponseChoice

type ChatCompletionChunkResponseChoice struct {
	Index        int `json:"index"`
	Delta        ChatCompletionChunkResponseDelta
	Logprobs     interface{} `json:"logprobs"` // Assuming logprobs can be null
	FinishReason interface{} `json:"finish_reason"`
}

type ChatCompletionChunkResponseDelta

type ChatCompletionChunkResponseDelta struct {
	Content string `json:"content"`
	Role    string `json:"role"`
}

type ChatCompletionChunkResponseUsage

type ChatCompletionChunkResponseUsage struct {
	QueueTime        float64 `json:"queue_time"`
	PromptTokens     int     `json:"prompt_tokens"`
	PromptTime       float64 `json:"prompt_time"`
	CompletionTokens int     `json:"completion_tokens"`
	CompletionTime   float64 `json:"completion_time"`
	TotalTokens      int     `json:"total_tokens"`
	TotalTime        float64 `json:"total_time"`
}

type ChatCompletionDone

type ChatCompletionDone struct {
	Done []string
}

type ChatCompletionResponse

type ChatCompletionResponse struct {
	ID      string `json:"id"`
	Object  string `json:"object"`
	Created int64  `json:"created"`
	Model   string `json:"model"`
	Choices []struct {
		Index   int `json:"index"`
		Message struct {
			Role    string `json:"role"`
			Content string `json:"content"`
		} `json:"message"`
		Logprobs     interface{} `json:"logprobs"` // Assuming logprobs can be null
		FinishReason string      `json:"finish_reason"`
	} `json:"choices"`
	Usage struct {
		PromptTokens     int     `json:"prompt_tokens"`
		PromptTime       float64 `json:"prompt_time"`
		CompletionTokens int     `json:"completion_tokens"`
		CompletionTime   float64 `json:"completion_time"`
		TotalTokens      int     `json:"total_tokens"`
		TotalTime        float64 `json:"total_time"`
	} `json:"usage"`
	SystemFingerprint string `json:"system_fingerprint"`
	XGroq             struct {
		ID string `json:"id"`
	} `json:"x_groq"`
}

type ChatError

type ChatError struct {
	Error map[string]string
}

type ErrorResponse

type ErrorResponse struct {
	Error struct {
		Message string `json:"message"`
		Type    string `json:"type"`
		Code    string `json:"code"`
	} `json:"error"`
}

type Message

type Message struct {
	Role    string `json:"role"`
	Content string `json:"content"`
}

Message is a message in a chat request

type StreamedResponse

type StreamedResponse struct {
	Data string `json:"data"`
}

Jump to

Keyboard shortcuts

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