handler

package
v0.0.0-...-bcb1c7f Latest Latest
Warning

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

Go to latest
Published: May 9, 2024 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	DefaultCookies      map[string]string
	Proxy               string
	DefaultRefreshToken string
	DefaultAPIKey       string
)
View Source
var HandlerMap = map[string]gin.HandlerFunc{
	"Creative":      BingCompleteChatHandler,
	"Balanced":      BingCompleteChatHandler,
	"Precise":       BingCompleteChatHandler,
	"gpt-3.5-turbo": BingCompleteChatHandler,
	"kimi":          KimiCompleteChatHandler,
	"gemini-pro":    GeminiCompleteChatHandler,
}

Functions

func BingCompleteChatHandler

func BingCompleteChatHandler(c *gin.Context)

func BingGenerateImageHandler

func BingGenerateImageHandler(c *gin.Context)

func BingImageCreateHandler

func BingImageCreateHandler(c *gin.Context)

func BingImageUploadHandler

func BingImageUploadHandler(c *gin.Context)

func BingStreamChatHandler

func BingStreamChatHandler(c *gin.Context)

func GeminiCompleteChatHandler

func GeminiCompleteChatHandler(c *gin.Context)

func GeminiStreamChatHandler

func GeminiStreamChatHandler(c *gin.Context)

func KimiCompleteChatHandler

func KimiCompleteChatHandler(c *gin.Context)

func KimiStreamChatHandler

func KimiStreamChatHandler(c *gin.Context)

func ModelBasedDispatcher

func ModelBasedDispatcher() gin.HandlerFunc

Types

type CreateConversationResponse

type CreateConversationResponse struct {
	ConversationId        string                   `json:"conversationId"`
	ClientId              string                   `json:"clientId"`
	Result                CreateConversationResult `json:"result"`
	SecAccessToken        string                   `json:"secAccessToken"`
	ConversationSignature string                   `json:"conversationSignature"`
	BearerToken           string                   `json:"bearerToken"`
}

type CreateConversationResult

type CreateConversationResult struct {
	Value   string `json:"value"`
	Message string `json:"message"`
}

type GeminiChatStreamRequest

type GeminiChatStreamRequest struct {
	Text   string `json:"text"`
	APIKey string `json:"apiKey"`
	Model  string `json:"model"`
}

type GeminiOpenAIChatCompletionRequest

type GeminiOpenAIChatCompletionRequest struct {
	Model      string                `json:"model"`
	Messages   []GeminiOpenAIMessage `json:"messages"`
	Stream     bool                  `json:"stream"`
	ToolChoice *interface{}          `json:"tool_choice"`
	APIKey     string                `json:"refreshToken"`
}

type GeminiOpenAIMessage

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

type ImageUploadRequest

type ImageUploadRequest struct {
	Cookies string                `form:"cookies"`
	File    *multipart.FileHeader `form:"file"`
}

type KimiChatStreamRequest

type KimiChatStreamRequest struct {
	Text         string `json:"text"`
	ConvId       string `json:"convId"`
	RefreshToken string `json:"refreshToken"`
	UseSearch    bool   `json:"useSearch"`
}

type KimiOpenAIChatCompletionRequest

type KimiOpenAIChatCompletionRequest struct {
	Model        string              `json:"model"`
	Messages     []KimiOpenAIMessage `json:"messages"`
	Stream       bool                `json:"stream"`
	ToolChoice   *interface{}        `json:"tool_choice"`
	RefreshToken string              `json:"refreshToken"`
	UseSearch    *bool               `json:"useSearch"`
}

type KimiOpenAIMessage

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

type OpenAIChatCompletionRequest

type OpenAIChatCompletionRequest struct {
	Model        string                     `json:"model"`
	Messages     []OpenAIMessage            `json:"messages"`
	Stream       bool                       `json:"stream"`
	ToolChoice   *interface{}               `json:"tool_choice"`
	Conversation CreateConversationResponse `json:"conversation"`
	RefreshToken string                     `json:"refreshToken"` // Kimi
	UseSearch    *bool                      `json:"useSearch"`    // Kimi
	APIKey       string                     `json:"apiKey"`       // Gemini
}

type OpenAIMessage

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

Jump to

Keyboard shortcuts

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