Documentation ¶
Index ¶
- Variables
- func FormatBytes(num float64, suffix string) (str string)
- func FormatRate(rate float64) (str string)
- type ChatCompletionChoice
- type ChatCompletionMessage
- type ChatCompletionRequest
- type ChatMessage
- type ChatRequest
- type CompletionMessage
- type CompletionRequest
- type Config
- type ConversationResponse
- type M
- type RespDone
- type Service
- type User
Constants ¶
This section is empty.
Variables ¶
View Source
var (
UserFromContext = staffio.UserFromContext
)
vars from staffio
Functions ¶
func FormatBytes ¶
FormatBytes formats a floating number as string with closest unit
func FormatRate ¶
FormatRate formats a floating point b/s as string with closest unit
Types ¶
type ChatCompletionChoice ¶
type ChatCompletionMessage ¶
type ChatCompletionMessage = openai.ChatCompletionMessage
type ChatCompletionRequest ¶
type ChatCompletionRequest struct { openai.ChatCompletionRequest // contains filtered or unexported fields }
type ChatMessage ¶
type ChatMessage struct { ID string `json:"id,omitempty"` Delta string `json:"delta,omitempty"` Text string `json:"text,omitempty"` Role string `json:"role,omitempty"` Name string `json:"name,omitempty"` FinishRsason string `json:"finishReason,omitempty"` // for github.com/Chanzhaoyu/chatgpt-web only ConversationId string `json:"conversationId,omitempty"` }
type ChatRequest ¶
type ChatRequest struct { Prompt string `json:"prompt"` ConversationID string `json:"csid"` ParentMessageID string `json:"pmid"` Stream bool `json:"stream"` Full bool `json:"full,omitempty"` // deprecated: for github.com/Chanzhaoyu/chatgpt-web only Options struct { ConversationId string `json:"conversationId,omitempty"` } }
type CompletionMessage ¶
type CompletionRequest ¶
type CompletionRequest struct { openai.CompletionRequest ConversationID string `json:"csid"` // contains filtered or unexported fields }
type ConversationResponse ¶
type ConversationResponse struct { ConversationID string `json:"csid"` ParentMessageID string `json:"pmid"` Detail struct { Choices []ChatCompletionChoice `json:"choices"` Created int64 `json:"created"` ID string `json:"id"` Model string `json:"model"` Object string `json:"object"` Usage struct { CompletionTokens int `json:"completionTokens"` PromptTokens int `json:"promptTokens"` TotalTokens int `json:"totalTokens"` } `json:"usage"` } `json:"detail"` }
Click to show internal directories.
Click to hide internal directories.