You've already forked agentic-coding-workflow
bugfix
This commit is contained in:
@@ -9,8 +9,12 @@ import (
|
||||
"github.com/anthropics/anthropic-sdk-go/option"
|
||||
)
|
||||
|
||||
// Compile-time assertion: AnthropicClient must satisfy LLMClient.
|
||||
var _ LLMClient = (*AnthropicClient)(nil)
|
||||
// Compile-time assertion: AnthropicClient must satisfy LLMClient + Embedder
|
||||
// (Embed returns ErrEmbeddingsUnsupported).
|
||||
var (
|
||||
_ LLMClient = (*AnthropicClient)(nil)
|
||||
_ Embedder = (*AnthropicClient)(nil)
|
||||
)
|
||||
|
||||
// AnthropicClient 通过官方 SDK 调用 Anthropic Messages API。
|
||||
// baseURL 可改写以走 LiteLLM/OpenRouter 等代理。
|
||||
@@ -152,3 +156,12 @@ func (c *AnthropicClient) CountTokens(ctx context.Context, modelID string, req R
|
||||
}
|
||||
return int(res.InputTokens), nil
|
||||
}
|
||||
|
||||
// Embed is unsupported: Anthropic has no embeddings API. Embeddings must target
|
||||
// an OpenAI-compatible or Gemini endpoint; callers degrade to keyword fallback.
|
||||
func (c *AnthropicClient) Embed(context.Context, string, []string) ([][]float32, error) {
|
||||
return nil, ErrEmbeddingsUnsupported
|
||||
}
|
||||
|
||||
// EmbedDims is 0 since Anthropic produces no embeddings.
|
||||
func (c *AnthropicClient) EmbedDims(string) int { return 0 }
|
||||
|
||||
Reference in New Issue
Block a user