Documentation ¶
Index ¶
- type ApiMessage
- func (am *ApiMessage) DevLogContext() string
- func (am *ApiMessage) GetProxyLatency() int64
- func (am *ApiMessage) ModifyFileds(c apiLoggerConfig)
- func (am *ApiMessage) SetBricksLlmLatency(latency int64)
- func (am *ApiMessage) SetClientIp(ip string)
- func (am *ApiMessage) SetCreatedAt(createdAt int64)
- func (am *ApiMessage) SetInstanceId(id string)
- func (am *ApiMessage) SetPath(path string)
- func (am *ApiMessage) SetProtocol(protocol string)
- func (am *ApiMessage) SetProxyLatency(latency int64)
- func (am *ApiMessage) SetRequestBodySize(size int64)
- func (am *ApiMessage) SetRequestHeaders(headers map[string][]string)
- func (am *ApiMessage) SetResponseBodySize(size int64)
- func (am *ApiMessage) SetResponseCreatedAt(createdAt int64)
- func (am *ApiMessage) SetResponseHeaders(headers map[string][]string)
- func (am *ApiMessage) SetResponseStatus(status int)
- func (am *ApiMessage) SetTotalLatency(latency int64)
- type Choice
- type ErrorMessage
- type Latency
- type LlmMessage
- func (lm *LlmMessage) DevLogContext() string
- func (lm *LlmMessage) ModifyFileds(c llmLoggerConfig)
- func (lm *LlmMessage) SetCompletionTokens(tokens int)
- func (lm *LlmMessage) SetCreatedAt(createdAt int64)
- func (lm *LlmMessage) SetEstimatedCost(cost float64)
- func (lm *LlmMessage) SetInstanceId(id string)
- func (lm *LlmMessage) SetLatency(latency int64)
- func (lm *LlmMessage) SetPromptTokens(tokens int)
- func (lm *LlmMessage) SetProvider(provider string)
- func (lm *LlmMessage) SetRequestCreatedAt(createdAt int64)
- func (lm *LlmMessage) SetRequestHeaders(headers map[string][]string)
- func (lm *LlmMessage) SetRequestMessages(messages []Message)
- func (lm *LlmMessage) SetRequestModel(model string)
- func (lm *LlmMessage) SetRequestSize(size int64)
- func (lm *LlmMessage) SetResponseBodySize(size int64)
- func (lm *LlmMessage) SetResponseChoices(choices []Choice)
- func (lm *LlmMessage) SetResponseCreatedAt(createdAt int64)
- func (lm *LlmMessage) SetResponseHeaders(headers map[string][]string)
- func (lm *LlmMessage) SetResponseId(id string)
- func (lm *LlmMessage) SetResponseStatus(status int)
- func (lm *LlmMessage) SetTotalTokens(tokens int)
- type LlmRequest
- type LlmResponse
- type Logger
- type Message
- type MessageType
- type Request
- type Response
- type Route
- type Token
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ApiMessage ¶
type ApiMessage struct { ClientIp string `json:"clientIp"` InstanceId string `json:"instanceId"` Latency *Latency `json:"latency"` CreatedAt int64 `json:"created_at"` Route *Route `json:"route"` Response *Response `json:"response"` Request *Request `json:"request"` Type MessageType `json:"type"` }
func NewApiMessage ¶
func NewApiMessage() *ApiMessage
func (*ApiMessage) DevLogContext ¶
func (am *ApiMessage) DevLogContext() string
func (*ApiMessage) GetProxyLatency ¶
func (am *ApiMessage) GetProxyLatency() int64
func (*ApiMessage) ModifyFileds ¶
func (am *ApiMessage) ModifyFileds(c apiLoggerConfig)
func (*ApiMessage) SetBricksLlmLatency ¶
func (am *ApiMessage) SetBricksLlmLatency(latency int64)
func (*ApiMessage) SetClientIp ¶
func (am *ApiMessage) SetClientIp(ip string)
func (*ApiMessage) SetCreatedAt ¶
func (am *ApiMessage) SetCreatedAt(createdAt int64)
func (*ApiMessage) SetInstanceId ¶
func (am *ApiMessage) SetInstanceId(id string)
func (*ApiMessage) SetPath ¶
func (am *ApiMessage) SetPath(path string)
func (*ApiMessage) SetProtocol ¶
func (am *ApiMessage) SetProtocol(protocol string)
func (*ApiMessage) SetProxyLatency ¶
func (am *ApiMessage) SetProxyLatency(latency int64)
func (*ApiMessage) SetRequestBodySize ¶
func (am *ApiMessage) SetRequestBodySize(size int64)
func (*ApiMessage) SetRequestHeaders ¶
func (am *ApiMessage) SetRequestHeaders(headers map[string][]string)
func (*ApiMessage) SetResponseBodySize ¶
func (am *ApiMessage) SetResponseBodySize(size int64)
func (*ApiMessage) SetResponseCreatedAt ¶
func (am *ApiMessage) SetResponseCreatedAt(createdAt int64)
func (*ApiMessage) SetResponseHeaders ¶
func (am *ApiMessage) SetResponseHeaders(headers map[string][]string)
func (*ApiMessage) SetResponseStatus ¶
func (am *ApiMessage) SetResponseStatus(status int)
func (*ApiMessage) SetTotalLatency ¶
func (am *ApiMessage) SetTotalLatency(latency int64)
type ErrorMessage ¶
type ErrorMessage struct { Type MessageType `json:"type"` InstanceId string `json:"instanceId"` Message string `json:"message"` CreatedAt int64 `json:"createdAt"` }
func NewErrorMessage ¶
func NewErrorMessage() *ErrorMessage
func (*ErrorMessage) DevLogContext ¶
func (em *ErrorMessage) DevLogContext() string
func (*ErrorMessage) SetCreatedAt ¶
func (em *ErrorMessage) SetCreatedAt(createdAt int64)
func (*ErrorMessage) SetInstanceId ¶
func (em *ErrorMessage) SetInstanceId(instanceId string)
func (*ErrorMessage) SetMessage ¶
func (em *ErrorMessage) SetMessage(message string)
type LlmMessage ¶
type LlmMessage struct { InstanceId string `json:"instanceId"` Type MessageType `json:"type"` Token *Token `json:"token"` Response *LlmResponse `json:"response"` Request *LlmRequest `json:"request"` Provider string `json:"provider"` EstimatedCost float64 `json:"estimated_cost"` CreatedAt int64 `json:"created_at"` Latency int64 `json:"latency"` }
func NewLlmMessage ¶
func NewLlmMessage() *LlmMessage
func (*LlmMessage) DevLogContext ¶
func (lm *LlmMessage) DevLogContext() string
func (*LlmMessage) ModifyFileds ¶
func (lm *LlmMessage) ModifyFileds(c llmLoggerConfig)
func (*LlmMessage) SetCompletionTokens ¶
func (lm *LlmMessage) SetCompletionTokens(tokens int)
func (*LlmMessage) SetCreatedAt ¶
func (lm *LlmMessage) SetCreatedAt(createdAt int64)
func (*LlmMessage) SetEstimatedCost ¶
func (lm *LlmMessage) SetEstimatedCost(cost float64)
func (*LlmMessage) SetInstanceId ¶
func (lm *LlmMessage) SetInstanceId(id string)
func (*LlmMessage) SetLatency ¶
func (lm *LlmMessage) SetLatency(latency int64)
func (*LlmMessage) SetPromptTokens ¶
func (lm *LlmMessage) SetPromptTokens(tokens int)
func (*LlmMessage) SetProvider ¶
func (lm *LlmMessage) SetProvider(provider string)
func (*LlmMessage) SetRequestCreatedAt ¶
func (lm *LlmMessage) SetRequestCreatedAt(createdAt int64)
func (*LlmMessage) SetRequestHeaders ¶
func (lm *LlmMessage) SetRequestHeaders(headers map[string][]string)
func (*LlmMessage) SetRequestMessages ¶
func (lm *LlmMessage) SetRequestMessages(messages []Message)
func (*LlmMessage) SetRequestModel ¶
func (lm *LlmMessage) SetRequestModel(model string)
func (*LlmMessage) SetRequestSize ¶
func (lm *LlmMessage) SetRequestSize(size int64)
func (*LlmMessage) SetResponseBodySize ¶
func (lm *LlmMessage) SetResponseBodySize(size int64)
func (*LlmMessage) SetResponseChoices ¶
func (lm *LlmMessage) SetResponseChoices(choices []Choice)
func (*LlmMessage) SetResponseCreatedAt ¶
func (lm *LlmMessage) SetResponseCreatedAt(createdAt int64)
func (*LlmMessage) SetResponseHeaders ¶
func (lm *LlmMessage) SetResponseHeaders(headers map[string][]string)
func (*LlmMessage) SetResponseId ¶
func (lm *LlmMessage) SetResponseId(id string)
func (*LlmMessage) SetResponseStatus ¶
func (lm *LlmMessage) SetResponseStatus(status int)
func (*LlmMessage) SetTotalTokens ¶
func (lm *LlmMessage) SetTotalTokens(tokens int)
type LlmRequest ¶
type LlmResponse ¶
type Logger ¶
type Logger interface { Infow(msg string, keysAndValues ...interface{}) Info(args ...interface{}) Infof(template string, args ...interface{}) Sync() error Debug(args ...interface{}) Debugf(template string, args ...interface{}) Debugw(template string, args ...interface{}) Fatalf(template string, args ...interface{}) Fatal(args ...interface{}) }
type MessageType ¶
type MessageType string
const ( LlmMessageType MessageType = "llm" ApiMessageType MessageType = "api" ErrorMessageType MessageType = "error" )
Click to show internal directories.
Click to hide internal directories.