Skip to content

Add target/named vector support to QA #35

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Apr 24, 2025
Merged

Conversation

cdpierse
Copy link
Collaborator

  • Adds support to QueryAgents run() method to support the target_vector argument which is to be used in cases where a underlying collection is configured using named vectors
  • If the constructor for the QA consists of multiple collections then the structure of target_vector must be a dict mapping of collection names to the underlying target vector name for example:
# Assume `client` is your WeaviateClient instance
agent = QueryAgent(
    client,
    collections=["collection1", "collection2"],
)

# Specify a target vector for each collection
target_vector = {
    "collection1": "vectorA",
    "collection2": "vectorB"
}

response = agent.run("your query here", target_vector=target_vector)

Copy link

@orca-security-eu orca-security-eu bot left a comment

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 Infrastructure as Code high 0   medium 0   low 0   info 0 View in Orca
Passed Passed SAST high 0   medium 0   low 0   info 0 View in Orca
Passed Passed Secrets high 0   medium 0   low 0   info 0 View in Orca
Passed Passed Vulnerabilities high 0   medium 0   low 0   info 0 View in Orca

@cdpierse cdpierse self-assigned this Apr 24, 2025
@cdpierse cdpierse added the enhancement New feature or request label Apr 24, 2025
@cdpierse cdpierse merged commit cefe1f9 into main Apr 24, 2025
13 checks passed
@cdpierse cdpierse deleted the named-vector-support branch April 24, 2025 14:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants