Documentation
¶
Index ¶
- Variables
- type ApiService
- func (s *ApiService) Chat(ctx context.Context, req *apiv1.ChatRequest) (*apiv1.ChatResponse, error)
- func (s *ApiService) ChatRealtime(stream apiv1.ApiService_ChatRealtimeServer) error
- func (s *ApiService) ChatStream(req *apiv1.ChatStreamRequest, stream apiv1.ApiService_ChatStreamServer) error
- func (s *ApiService) ClaudeCreateMessage(c echo.Context) error
- func (s *ApiService) OpenaiCompletion(c echo.Context) error
- type ClaudeContent
- type ClaudeDelta
- type ClaudeImageSource
- type ClaudeMessage
- type ClaudeMessageRequest
- type ClaudeMessageResponse
- type ClaudeMetadata
- type ClaudeStreamEvent
- type ClaudeThinking
- type ClaudeTool
- type ClaudeToolChoice
- type ClaudeUsage
Constants ¶
This section is empty.
Variables ¶
View Source
var ( GrpcArgumentError = status.Errorf(codes.InvalidArgument, "Invalid Argument") GrpcInternalError = status.Errorf(codes.Internal, "Internal Server Error") )
Functions ¶
This section is empty.
Types ¶
type ApiService ¶
type ApiService struct {
apiv1.UnimplementedApiServiceServer
// contains filtered or unexported fields
}
func NewApiService ¶
func NewApiService(models *llmx.Models) *ApiService
func (*ApiService) Chat ¶
func (s *ApiService) Chat(ctx context.Context, req *apiv1.ChatRequest) (*apiv1.ChatResponse, error)
func (*ApiService) ChatRealtime ¶
func (s *ApiService) ChatRealtime(stream apiv1.ApiService_ChatRealtimeServer) error
func (*ApiService) ChatStream ¶
func (s *ApiService) ChatStream(req *apiv1.ChatStreamRequest, stream apiv1.ApiService_ChatStreamServer) error
func (*ApiService) ClaudeCreateMessage ¶
func (s *ApiService) ClaudeCreateMessage(c echo.Context) error
func (*ApiService) OpenaiCompletion ¶
func (s *ApiService) OpenaiCompletion(c echo.Context) error
type ClaudeContent ¶
type ClaudeContent struct {
Type string `json:"type"`
Text string `json:"text,omitempty"`
Thinking string `json:"thinking,omitempty"`
Signature string `json:"signature,omitempty"`
Source *ClaudeImageSource `json:"source,omitempty"`
ID string `json:"id,omitempty"`
Name string `json:"name,omitempty"`
Input interface{} `json:"input,omitempty"`
ToolUseID string `json:"tool_use_id,omitempty"`
Content interface{} `json:"content,omitempty"` // For tool_result
}
type ClaudeDelta ¶
type ClaudeDelta struct {
Type string `json:"type"`
Text string `json:"text,omitempty"`
Thinking string `json:"thinking,omitempty"`
Signature string `json:"signature,omitempty"`
PartialJson string `json:"partial_json,omitempty"`
StopReason *string `json:"stop_reason,omitempty"`
StopSequence *string `json:"stop_sequence,omitempty"`
}
type ClaudeImageSource ¶
type ClaudeMessage ¶
type ClaudeMessage struct {
Role string `json:"role"`
Content interface{} `json:"content"` // string or []ClaudeContent
}
type ClaudeMessageRequest ¶
type ClaudeMessageRequest struct {
Model string `json:"model"`
Messages []ClaudeMessage `json:"messages"`
System interface{} `json:"system,omitempty"` // string or []ClaudeContent
MaxTokens int64 `json:"max_tokens,omitempty"`
Metadata *ClaudeMetadata `json:"metadata,omitempty"`
StopSequences []string `json:"stop_sequences,omitempty"`
Stream bool `json:"stream,omitempty"`
Temperature *float32 `json:"temperature,omitempty"`
TopP *float32 `json:"top_p,omitempty"`
TopK *int `json:"top_k,omitempty"`
Tools []ClaudeTool `json:"tools,omitempty"`
ToolChoice *ClaudeToolChoice `json:"tool_choice,omitempty"`
Thinking *ClaudeThinking `json:"thinking,omitempty"`
}
type ClaudeMessageResponse ¶
type ClaudeMessageResponse struct {
ID string `json:"id"`
Type string `json:"type"`
Role string `json:"role"`
Content []ClaudeContent `json:"content"`
Model string `json:"model"`
StopReason *string `json:"stop_reason"`
StopSequence *string `json:"stop_sequence"`
Usage ClaudeUsage `json:"usage"`
}
type ClaudeMetadata ¶
type ClaudeMetadata struct {
UserID string `json:"user_id,omitempty"`
}
type ClaudeStreamEvent ¶
type ClaudeStreamEvent struct {
Type string `json:"type"`
Message *ClaudeMessageResponse `json:"message,omitempty"`
Index int `json:"index,omitempty"`
ContentBlock *ClaudeContent `json:"content_block,omitempty"`
Delta *ClaudeDelta `json:"delta,omitempty"`
Usage *ClaudeUsage `json:"usage,omitempty"`
}
Streaming events
type ClaudeThinking ¶
type ClaudeTool ¶
type ClaudeToolChoice ¶
type ClaudeUsage ¶
Click to show internal directories.
Click to hide internal directories.