Skip to content

feat(anthropic): add generative-anthropic module - #505

Open
databyjp wants to merge 2 commits into
v6from
feat/v6-generative-anthropic
Open

databyjp wants to merge 2 commits into
v6from
feat/v6-generative-anthropic

Conversation

@databyjp

@databyjp databyjp commented Nov 4, 2026

Copy link
Copy Markdown

No description provided.

@databyjp
databyjp requested a review from bevzzz November 4, 2026 18:16

@orca-security-eu orca-security-eu Bot left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Orca Security Scan Summary

Status Check Issues by priority
Passed Passed Secrets high 0   medium 0   low 0   info 0 View in Orca

claude-haiku-5-5 returns a leading thinking block, which the server's
generative-anthropic module currently reads as empty text.
Comment on lines +30 to +36
// Claude 4.7 and later models reject them with an error, and some
// earlier models reject Temperature and TopP set together.
// Leave them unset unless the target model accepts them.
//
// See [Anthropic Docs - Messages API].
//
// [Anthropic Docs - Messages API]: https://platform.claude.com/docs/en/build-with-claude/working-with-messages

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

suggestion: looks like this is something that is better left for Weaviate Docs to clarify. E.g. Claude 4.7 and later models rejects Temaperature with an error is not client's behavior.

Comment on lines +37 to +39
Temperature *float64 `json:"temperature,omitempty"`
TopK *int64 `json:"topK,omitempty"`
TopP *float64 `json:"topP,omitempty"`

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Temperature *float64 `json:"temperature,omitempty"`
TopK *int64 `json:"topK,omitempty"`
TopP *float64 `json:"topP,omitempty"`
Temperature *float64 `json:"temperature,omitzero"`
TopK *int64 `json:"topK,omitzero"`
TopP *float64 `json:"topP,omitzero"`

question: is 0 a reasonable value for any of these parameters? If not, I'd suggest using a primitive type instead and adding omitzero tag. Same goes for MaxTokens above.

type Provider struct {
// Images are base64-encoded images passed to the model with the prompt.
Images []string
// ImageProperties name the object properties that contain images for the prompt.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
// ImageProperties name the object properties that contain images for the prompt.
// ImageProperties lists the object properties that contain images for the prompt.

nit: imo "name" here is a claudism, "pseudo-elevated diction" as the source describes it

type Generative struct {
// BaseURL overrides the default request URL, e.g. a proxy.
BaseURL string `json:"baseURL,omitempty"`
// Model is the Anthropic model name, e.g. "claude-haiku-4-5".

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
// Model is the Anthropic model name, e.g. "claude-haiku-4-5".
// Model name.

nit: the example value is redundant here, as all modules which have .Model field expect the same kind of input.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants