1 Star 0 Fork 0

金闽 / claude

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
response.go 2.07 KB
一键复制 编辑 原始数据 按行查看 历史
金闽 提交于 2024-04-24 21:20 . claude
package claude
// CompletionResponse is the response from the Anthropic API for a completion request.
type CompletionResponse struct {
Completion string `json:"completion"`
StopReason string `json:"stop_reason"`
Stop string `json:"stop"`
}
// StreamResponse is the response from the Anthropic API for a stream of completions.
type StreamResponse struct {
Completion string `json:"completion"`
StopReason string `json:"stop_reason"`
Model string `json:"model"`
Stop string `json:"stop"`
LogID string `json:"log_id"`
}
// MessageResponse is a subset of the response from the Anthropic API for a message response.
type MessagePartResponse struct {
Type string `json:"type"`
Text string `json:"text"`
// Optional fields, only present for tools responses
ID string `json:"id,omitempty"`
Name string `json:"name,omitempty"`
Input map[string]interface{} `json:"input,omitempty"`
}
// MessageResponse is the response from the Anthropic API for a message response.
type MessageResponse struct {
ID string `json:"id"`
Type string `json:"type"`
Model string `json:"model"`
Role string `json:"role"`
Content []MessagePartResponse `json:"content"`
StopReason string `json:"stop_reason"`
Stop string `json:"stop"`
StopSequence string `json:"stop_sequence"`
Usage MessageUsage `json:"usage"`
}
type MessageUsage struct {
InputTokens int `json:"input_tokens"`
OutputTokens int `json:"output_tokens"`
}
type MessageStreamResponse struct {
Type string `json:"type"`
Delta MessageStreamDelta `json:"delta"`
Usage MessageStreamUsage `json:"usage"`
}
type MessageStreamDelta struct {
Type string `json:"type"`
Text string `json:"text"`
StopReason string `json:"stop_reason"`
StopSequence string `json:"stop_sequence"`
}
type MessageStreamUsage struct {
InputTokens int `json:"input_tokens"`
OutputTokens int `json:"output_tokens"`
}
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/dn-jinmin/claude.git
git@gitee.com:dn-jinmin/claude.git
dn-jinmin
claude
claude
master

搜索帮助

344bd9b3 5694891 D2dac590 5694891