Documentation
¶
Index ¶
- Constants
- func ListModels() []string
- type Attachment
- type ChatMessage
- type ChatMessageResponse
- type ClaudeWeb
- func (c *ClaudeWeb) CreateConversation(ctx context.Context, name string) (llm.Conversation, error)
- func (c *ClaudeWeb) CreateMessage(ctx context.Context, conversationId string, req llm.ChatCompletionRequest) (llm.Message, error)
- func (c *ClaudeWeb) CreateMessageStream(ctx context.Context, conversationId string, req llm.ChatCompletionRequest, ...)
- type Client
- func (cw *Client) CreateChatCompletion(ctx context.Context, req llm.ChatCompletionRequest) (llm.ChatCompletionResponse, error)
- func (cw *Client) CreateChatCompletionStream(ctx context.Context, req llm.ChatCompletionRequest, ...)
- func (cw *Client) CreateChatMessage(id, prompt string) (*ChatMessageResponse, error)
- func (cw *Client) CreateChatMessageStream(id, prompt string, streamChan chan *ChatMessageResponse, errChan chan error)
- func (cw *Client) CreateConversation(name string) (*Conversation, error)
- func (cw *Client) DeleteConversation(id string) error
- func (cw *Client) GetConversation(id string) (*Conversation, error)
- func (cw *Client) GetModel() string
- func (cw *Client) GetOrgId() string
- func (cw *Client) GetOrganizations() ([]*Organization, error)
- func (cw *Client) ListConversations() ([]*Conversation, error)
- func (cw *Client) ListModels() []string
- func (cw *Client) UpdateConversation(id string, name string) error
- type Completion
- type Conversation
- type CreateChatMessageRequest
- type Organization
- type Settings
- type UpdateConversationRequest
Constants ¶
View Source
const (
ModelClaudeWeb = "claude-2"
)
Variables ¶
This section is empty.
Functions ¶
func ListModels ¶
func ListModels() []string
Types ¶
type Attachment ¶
type ChatMessage ¶
type ChatMessage struct {
UUID string `json:"uuid"`
Text string `json:"text"`
Sender string `json:"sender"`
Index int `json:"index"`
CreatedAt string `json:"created_at"`
UpdatedAt string `json:"updated_at"`
EditedAt string `json:"edited_at"`
ChatFeedback string `json:"chat_feedback"`
Attachments []Attachment `json:"attachments"`
}
type ChatMessageResponse ¶
type ChatMessageResponse struct {
Completion string `json:"completion"`
StopReason string `json:"stop_reason"`
Model string `json:"model"`
Stop string `json:"stop"`
LogId string `json:"log_id"`
MessageLimit struct {
Type string `json:"type"`
} `json:"message_limit"`
}
func (*ChatMessageResponse) ToChatCompletionResponse ¶
func (cr *ChatMessageResponse) ToChatCompletionResponse() llm.ChatCompletionResponse
func (*ChatMessageResponse) ToChatCompletionStreamResponse ¶
func (cr *ChatMessageResponse) ToChatCompletionStreamResponse() llm.ChatCompletionStreamResponse
type ClaudeWeb ¶
ClaudeWeb is a Claude request client
func (*ClaudeWeb) CreateConversation ¶
func (*ClaudeWeb) CreateMessage ¶
func (*ClaudeWeb) CreateMessageStream ¶
func (c *ClaudeWeb) CreateMessageStream(ctx context.Context, conversationId string, req llm.ChatCompletionRequest, respChan chan llm.ChatCompletionStreamResponse, errChan chan error)
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func (*Client) CreateChatCompletion ¶
func (cw *Client) CreateChatCompletion(ctx context.Context, req llm.ChatCompletionRequest) (llm.ChatCompletionResponse, error)
func (*Client) CreateChatCompletionStream ¶
func (cw *Client) CreateChatCompletionStream(ctx context.Context, req llm.ChatCompletionRequest, dataChan chan llm.ChatCompletionStreamResponse, errChan chan error)
func (*Client) CreateChatMessage ¶
func (cw *Client) CreateChatMessage(id, prompt string) (*ChatMessageResponse, error)
func (*Client) CreateChatMessageStream ¶
func (cw *Client) CreateChatMessageStream(id, prompt string, streamChan chan *ChatMessageResponse, errChan chan error)
func (*Client) CreateConversation ¶
func (cw *Client) CreateConversation(name string) (*Conversation, error)
CreateConversation is used to create conversation
func (*Client) DeleteConversation ¶
DeleteConversation is used to delete conversation
func (*Client) GetConversation ¶
func (cw *Client) GetConversation(id string) (*Conversation, error)
GetConversation is used to get conversation
func (*Client) GetOrganizations ¶
func (cw *Client) GetOrganizations() ([]*Organization, error)
func (*Client) ListConversations ¶
func (cw *Client) ListConversations() ([]*Conversation, error)
func (*Client) ListModels ¶
type Completion ¶
type Conversation ¶
type Conversation struct {
UUID string `json:"uuid"`
Name string `json:"name"`
Summary string `json:"summary"`
CreatedAt string `json:"created_at"`
UpdatedAt string `json:"updated_at"`
ChatMessages []ChatMessage `json:"chat_messages"`
}
func (Conversation) ToLLMConversation ¶
func (c Conversation) ToLLMConversation() llm.Conversation
type CreateChatMessageRequest ¶
type CreateChatMessageRequest struct {
Completion Completion `json:"completion"`
OrganizationUUID string `json:"organization_uuid"`
ConversationUUID string `json:"conversation_uuid"`
Text string `json:"text"`
Attachments []Attachment `json:"attachments"`
}
type Organization ¶
type Organization struct {
UUID string `json:"uuid"`
Name string `json:"name"`
Settings struct {
ClaudeConsolePrivacy string `json:"claude_console_privacy"`
} `json:"settings"`
Capabilities []string `json:"capabilities"`
BillableUsagePausedUntil interface{} `json:"billable_usage_paused_until"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
ActiveFlags []struct {
Id string `json:"id"`
Type string `json:"type"`
CreatedAt time.Time `json:"created_at"`
DismissedAt interface{} `json:"dismissed_at"`
ExpiresAt interface{} `json:"expires_at"`
} `json:"active_flags"`
}
type Settings ¶
type Settings struct {
ClaudeConsolePrivacy string `json:"claude_console_privacy"`
}
Click to show internal directories.
Click to hide internal directories.