Documentation ¶
Index ¶
- Constants
- type Attachment
- type ChatMessage
- type ChatMessageResponse
- type ClaudeWeb
- func (c *ClaudeWeb) CreateChatMessage(id, prompt string) (*ChatMessageResponse, error)
- func (c *ClaudeWeb) CreateChatMessageStream(id, prompt string, streamChan chan *ChatMessageResponse, errChan chan error)
- func (c *ClaudeWeb) CreateChatMessageStreamWithFullResponse(id, prompt string, streamChan chan *ChatMessageResponse, ...)
- func (c *ClaudeWeb) CreateConversation(name string) (*Conversation, error)
- func (c *ClaudeWeb) DeleteConversation(id string) error
- func (c *ClaudeWeb) GetConversation(id string) (*Conversation, error)
- func (c *ClaudeWeb) GetOrganizations() ([]*Organization, error)
- func (c *ClaudeWeb) ListConversations() ([]*Conversation, error)
- func (c *ClaudeWeb) UpdateConversation(id string, name string) error
- type Client
- type Completion
- type Conversation
- type CreateChatMessageRequest
- type MixMap
- type Option
- func WithBaseUri(baseUri string) Option
- func WithDebug(debug bool) Option
- func WithJA3(ja3 string) Option
- func WithModel(model string) Option
- func WithOrgid(orgid string) Option
- func WithProxy(proxy string) Option
- func WithSessionKey(sessionKey string) Option
- func WithTimeout(timeout time.Duration) Option
- func WithUserAgent(userAgent string) Option
- type Options
- type Organization
- type Settings
- type UpdateConversationRequest
Constants ¶
View Source
const ( DEFAULT_MODEL = "claude-2" DEFAULT_TIMEZONE = "Asia/Shanghai" )
View Source
const ( BASE_URI = "https://claude.ai" UA = "Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/86.0.4240.198 Safari/537.36" JA3 = "" /* 137-byte string literal not displayed */ )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
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 ClaudeWeb ¶
type ClaudeWeb struct { Client // contains filtered or unexported fields }
func NewClaudeWeb ¶
NewClaudeWeb returns a new ClaudeWeb client
func (*ClaudeWeb) CreateChatMessage ¶
func (c *ClaudeWeb) CreateChatMessage(id, prompt string) (*ChatMessageResponse, error)
func (*ClaudeWeb) CreateChatMessageStream ¶
func (c *ClaudeWeb) CreateChatMessageStream(id, prompt string, streamChan chan *ChatMessageResponse, errChan chan error)
func (*ClaudeWeb) CreateChatMessageStreamWithFullResponse ¶
func (c *ClaudeWeb) CreateChatMessageStreamWithFullResponse(id, prompt string, streamChan chan *ChatMessageResponse, fullRespChan chan string, errChan chan error)
func (*ClaudeWeb) CreateConversation ¶
func (c *ClaudeWeb) CreateConversation(name string) (*Conversation, error)
CreateConversation is used to create conversation
func (*ClaudeWeb) DeleteConversation ¶
DeleteConversation is used to delete conversation
func (*ClaudeWeb) GetConversation ¶
func (c *ClaudeWeb) GetConversation(id string) (*Conversation, error)
GetConversation is used to get conversation
func (*ClaudeWeb) GetOrganizations ¶
func (c *ClaudeWeb) GetOrganizations() ([]*Organization, error)
func (*ClaudeWeb) ListConversations ¶
func (c *ClaudeWeb) ListConversations() ([]*Conversation, error)
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client is a ChatGPT request client
type Completion ¶
type 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 MixMap ¶
type MixMap = map[string]interface{}
MixMap is a type alias for map[string]interface{}
type Option ¶
type Option func(*Client)
Option is used to set custom option
func WithSessionKey ¶
WithSessionKey is used to set session key in cookie
func WithTimeout ¶
WithTimeout is used to set request timeout
func WithUserAgent ¶
WithUserAgent is used to set user_agent
type Options ¶
type Options struct { // Debug is used to output debug message Debug bool // Timeout is used to end http request after timeout duration Timeout time.Duration // Proxy is used to proxy request Proxy string // SessionKey is used to set authorization key SessionKey string // Model is the chat model Model string // BaseUri is the api base uri BaseUri string // UserAgent is used to set user agent in header UserAgent string // Orgid is user's uuid Orgid string // JA3 is used to set ja3 JA3 string }
Options for request client
type Organization ¶
type Settings ¶
type Settings struct {
ClaudeConsolePrivacy string `json:"claude_console_privacy"`
}
Click to show internal directories.
Click to hide internal directories.