Documentation ¶
Index ¶
Constants ¶
View Source
const ( BaseURL = "https://open.bigmodel.cn/api/paas/v3/model-api" InvokeTypeSync = "invoke" InvokeTypeAsync = "async-invoke" InvokeTypeSSE = "sse-invoke" APITimeout = 300 * time.Second ChatGLMLite = "chatglm_lite" ChatGLMStd = "chatglm_std" ChatGLMPro = "chatglm_pro" )
View Source
const ( APITokenTTLSeconds = 3 * 60 APIKeyPartCount = 2 )
Variables ¶
This section is empty.
Functions ¶
func QueryAsyncInvokeResult ¶
Types ¶
type ModelAPI ¶
type ModelAPI struct { Model string Prompt []map[string]interface{} TopP float64 Temperature float64 }
func (ModelAPI) AsyncInvoke ¶
type SSEClient ¶
type SSEClient struct {
// contains filtered or unexported fields
}
SSEClient represents a Server-Sent Events (SSE) client.
func NewSSEClient ¶
NewSSEClient creates a new SSEClient instance.
func (*SSEClient) ReadEvents ¶
ReadEvents reads SSE events from the event source and returns them as a channel.
Click to show internal directories.
Click to hide internal directories.