Documentation
¶
Index ¶
- type BatchAdapter
- func (a *BatchAdapter) Cancel(ctx context.Context, providerJobID string) error
- func (a *BatchAdapter) Create(ctx context.Context, req *modality.BatchRequest) (*modality.BatchJob, error)
- func (a *BatchAdapter) Get(ctx context.Context, providerJobID string) (*modality.BatchStatus, error)
- func (a *BatchAdapter) Output(ctx context.Context, providerJobID string) (io.ReadCloser, error)
- type ChatAdapter
- type Client
- type FilesAdapter
- func (a *FilesAdapter) Delete(ctx context.Context, providerFileID string) error
- func (a *FilesAdapter) Get(ctx context.Context, providerFileID string) (*modality.ProviderFileHandle, error)
- func (a *FilesAdapter) Materialize(ctx context.Context, req *modality.FileMaterializeRequest) (*modality.ProviderFileHandle, error)
- func (a *FilesAdapter) Upload(ctx context.Context, req *modality.FileUploadRequest) (*modality.ProviderFileHandle, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BatchAdapter ¶
type BatchAdapter struct {
// contains filtered or unexported fields
}
func NewBatchAdapter ¶
func NewBatchAdapter(client *Client, provider string) *BatchAdapter
func (*BatchAdapter) Cancel ¶
func (a *BatchAdapter) Cancel(ctx context.Context, providerJobID string) error
func (*BatchAdapter) Create ¶
func (a *BatchAdapter) Create(ctx context.Context, req *modality.BatchRequest) (*modality.BatchJob, error)
func (*BatchAdapter) Get ¶
func (a *BatchAdapter) Get(ctx context.Context, providerJobID string) (*modality.BatchStatus, error)
func (*BatchAdapter) Output ¶
func (a *BatchAdapter) Output(ctx context.Context, providerJobID string) (io.ReadCloser, error)
type ChatAdapter ¶
type ChatAdapter struct {
*anthropiccompat.ChatAdapter
// contains filtered or unexported fields
}
ChatAdapter is the shared Anthropic-compatible chat adapter with Anthropic's native extensions enabled (thinking budget, hosted tools, per-request beta headers) plus the native count_tokens endpoint. Complete/Stream and the native CreateMessage/StreamMessage passthrough are inherited from the compat adapter.
func NewChatAdapter ¶
func NewChatAdapter(client *Client, model string, defaultMaxTokens int) *ChatAdapter
func (*ChatAdapter) CountTokens ¶
func (a *ChatAdapter) CountTokens(ctx context.Context, req *modality.ChatRequest) (*modality.TokenCountResult, error)
CountTokens uses Anthropic's native /v1/messages/count_tokens endpoint.
type Client ¶
type Client struct {
*anthropiccompat.Client
}
Client is the native Anthropic client: the shared Anthropic-compatible transport configured with Anthropic's x-api-key + anthropic-version auth headers. Per-request anthropic-beta headers are supplied by the chat adapter through the compat client's JSONWithBetas/StreamWithBetas.
func NewClient ¶
func NewClient(cfg config.ProviderConfig) *Client
type FilesAdapter ¶
type FilesAdapter struct {
// contains filtered or unexported fields
}
func NewFilesAdapter ¶
func NewFilesAdapter(client *Client, provider string) *FilesAdapter
func (*FilesAdapter) Delete ¶
func (a *FilesAdapter) Delete(ctx context.Context, providerFileID string) error
func (*FilesAdapter) Get ¶
func (a *FilesAdapter) Get(ctx context.Context, providerFileID string) (*modality.ProviderFileHandle, error)
func (*FilesAdapter) Materialize ¶
func (a *FilesAdapter) Materialize(ctx context.Context, req *modality.FileMaterializeRequest) (*modality.ProviderFileHandle, error)
func (*FilesAdapter) Upload ¶
func (a *FilesAdapter) Upload(ctx context.Context, req *modality.FileUploadRequest) (*modality.ProviderFileHandle, error)