Skip to content

Conversation

Bhargav129
Copy link

@Bhargav129 Bhargav129 commented Sep 23, 2025

Description of changes

Corrected the argument name in intro-to-retrieval.md examples:

queryTexts → query_texts

Updated both Python and TypeScript code snippets in the “Process the User's Query” section.

This resolves runtime errors when users copy the example code.

  • Improvements & Bug fixes
    • Documentation bug fix: corrected parameter name to match actual API.
  • New functionality
    • No new functionality

Test plan

  • Verified by running the example with collection.query(query_texts=[user_query], n_results=3) — no error occurs.

Migration plan

  • No migrations needed.
  • No backward compatibility issues (API itself is unchanged; this is just correcting docs).

Observability plan

  • Not applicable (docs change only).

Documentation Changes

  • Updated docs/docs.trychroma.com (intro-to-retrieval.md) with correct parameter name.

  • No further doc changes required.

While using the Retrieval module, I noticed that the documentation in the Process the User's Query section suggests using queryTexts as an argument for the query() method.

Existing code:
context = customer_support_collection.query(
    queryTexts=[user_query],
    n_results=1
)['documents'][0]
This leads to the following runtime error:
context = annual_reports_collection.query(
TypeError: query() got an unexpected keyword argument 'queryTexts'

ProposeChanges:
context = collection.query(
    query_texts=[user_query],
    n_results=3
)['documents'][0]
Copy link

Reviewer Checklist

Please leverage this checklist to ensure your code review is thorough before approving

Testing, Bugs, Errors, Logs, Documentation

  • Can you think of any use case in which the code does not behave as intended? Have they been tested?
  • Can you think of any inputs or external events that could break the code? Is user input validated and safe? Have they been tested?
  • If appropriate, are there adequate property based tests?
  • If appropriate, are there adequate unit tests?
  • Should any logging, debugging, tracing information be added or removed?
  • Are error messages user-friendly?
  • Have all documentation changes needed been made?
  • Have all non-obvious changes been commented?

System Compatibility

  • Are there any potential impacts on other parts of the system or backward compatibility?
  • Does this change intersect with any items on our roadmap, and if so, is there a plan for fitting them together?

Quality

  • Is this code of a unexpectedly high quality (Readability, Modularity, Intuitiveness)

Copy link
Contributor

propel-code-bot bot commented Sep 23, 2025

Fix documentation to use correct parameter name in retrieval query examples

This PR corrects the parameter name in code examples within the Process the User's Query section of the intro-to-retrieval.md documentation file. Previously, the documentation erroneously used queryTexts as an argument to the query() method, which is not recognized by the actual API and causes a runtime error. The parameter has been updated to query_texts in both Python and TypeScript code blocks, ensuring consistency between the documentation and the current API signature.

Key Changes

• Replaced all instances of queryTexts with query_texts in Python and TypeScript code examples in docs/docs.trychroma.com/markdoc/content/guides/build/intro-to-retrieval.md.
• Ensured parameter naming in documentation matches the actual query() method interface.

Affected Areas

docs/docs.trychroma.com/markdoc/content/guides/build/intro-to-retrieval.md (documentation file, code blocks)

This summary was automatically generated by @propel-code-bot

@Bhargav129 Bhargav129 changed the title Update intro-to-retrieval.md Fix incorrect parameter name in docs (queryTexts → query_texts) Sep 23, 2025
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.

1 participant