Documentation
¶
Index ¶
- Constants
- func BuildAudioSpeechRequest(model string) (io.Reader, error)
- func BuildChatCompletionRequest(model string) (io.Reader, error)
- func BuildCompletionsRequest(model string) (io.Reader, error)
- func BuildEmbeddingsRequest(model string) (io.Reader, error)
- func BuildImagesGenerationsRequest(modelConfig model.ModelConfig) (io.Reader, error)
- func BuildModerationsRequest(model string) (io.Reader, error)
- func BuildRequest(modelConfig model.ModelConfig) (io.Reader, mode.Mode, error)
- func BuildRerankRequest(model string) (io.Reader, error)
- func DoRequest(req *http.Request, timeout time.Duration) (*http.Response, error)
- func GetImageScannerBuffer() *[]byte
- func GetScannerBuffer() *[]byte
- func IsGeminiStreamRequest(path string) bool
- func IsImageModel(modelName string) bool
- func IsStreamResponse(resp *http.Response) bool
- func IsStreamResponseWithHeader(header http.Header) bool
- func NewScanner(r io.Reader) (*bufio.Scanner, func())
- func NewStreamScanner(r io.Reader, modelName string) (*bufio.Scanner, func())
- func PutImageScannerBuffer(buf *[]byte)
- func PutScannerBuffer(buf *[]byte)
- func UnmarshalAnthropicMessageRequest(req *http.Request) (*model.AnthropicMessageRequest, error)
- func UnmarshalGeminiChatRequest(req *http.Request) (*model.GeminiChatRequest, error)
- func UnmarshalGeneralOpenAIRequest(req *http.Request) (*model.GeneralOpenAIRequest, error)
- func UnmarshalGeneralThinking(req *http.Request) (model.GeneralOpenAIThinkingRequest, error)
- func UnmarshalGeneralThinkingFromNode(node *ast.Node) (model.GeneralOpenAIThinkingRequest, error)
- func UnmarshalImageRequest(req *http.Request) (*model.ImageRequest, error)
- func UnmarshalMap(req *http.Request) (map[string]any, error)
- func UnmarshalRerankRequest(req *http.Request) (*model.RerankRequest, error)
- func UnmarshalTTSRequest(req *http.Request) (*model.TextToSpeechRequest, error)
- func UnmarshalVideoGenerationJobRequest(req *http.Request) (*model.VideoGenerationJobRequest, error)
- type UnsupportedModelTypeError
Constants ¶
View Source
const ImageScannerBufferSize = 50 * 1024 * 1024
Variables ¶
This section is empty.
Functions ¶
func BuildImagesGenerationsRequest ¶
func BuildImagesGenerationsRequest(modelConfig model.ModelConfig) (io.Reader, error)
func BuildRequest ¶
func GetImageScannerBuffer ¶
func GetImageScannerBuffer() *[]byte
func GetScannerBuffer ¶
func GetScannerBuffer() *[]byte
func IsGeminiStreamRequest ¶
IsGeminiStreamRequest checks if the request path ends with :streamGenerateContent
func IsImageModel ¶
IsImageModel checks if the model name indicates an image generation model
func IsStreamResponse ¶
func NewScanner ¶
NewScanner creates a bufio.Scanner with standard buffer size. Returns the scanner and a cleanup function that must be called when done.
func NewStreamScanner ¶
NewStreamScanner creates a bufio.Scanner with appropriate buffer size based on model type. Returns the scanner and a cleanup function that must be called when done.
func PutImageScannerBuffer ¶
func PutImageScannerBuffer(buf *[]byte)
func PutScannerBuffer ¶
func PutScannerBuffer(buf *[]byte)
func UnmarshalAnthropicMessageRequest ¶
func UnmarshalAnthropicMessageRequest(req *http.Request) (*model.AnthropicMessageRequest, error)
func UnmarshalGeminiChatRequest ¶
func UnmarshalGeminiChatRequest(req *http.Request) (*model.GeminiChatRequest, error)
func UnmarshalGeneralOpenAIRequest ¶
func UnmarshalGeneralOpenAIRequest(req *http.Request) (*model.GeneralOpenAIRequest, error)
func UnmarshalGeneralThinking ¶
func UnmarshalGeneralThinking(req *http.Request) (model.GeneralOpenAIThinkingRequest, error)
func UnmarshalGeneralThinkingFromNode ¶
func UnmarshalGeneralThinkingFromNode(node *ast.Node) (model.GeneralOpenAIThinkingRequest, error)
func UnmarshalImageRequest ¶
func UnmarshalImageRequest(req *http.Request) (*model.ImageRequest, error)
func UnmarshalRerankRequest ¶
func UnmarshalRerankRequest(req *http.Request) (*model.RerankRequest, error)
func UnmarshalTTSRequest ¶
func UnmarshalTTSRequest(req *http.Request) (*model.TextToSpeechRequest, error)
func UnmarshalVideoGenerationJobRequest ¶
func UnmarshalVideoGenerationJobRequest( req *http.Request, ) (*model.VideoGenerationJobRequest, error)
Types ¶
type UnsupportedModelTypeError ¶
type UnsupportedModelTypeError struct {
ModelType string
}
func NewErrUnsupportedModelType ¶
func NewErrUnsupportedModelType(modelType string) *UnsupportedModelTypeError
func (*UnsupportedModelTypeError) Error ¶
func (e *UnsupportedModelTypeError) Error() string
Click to show internal directories.
Click to hide internal directories.