Skip to content

Fix two docstring mismatches in ConversationHistory.build_context - #2475

Open
Anton Karpov (karpovantonme) wants to merge 1 commit into
microsoft:mainfrom
karpovantonme:docs/build-context-params
Open

Fix two docstring mismatches in ConversationHistory.build_context#2475
Anton Karpov (karpovantonme) wants to merge 1 commit into
microsoft:mainfrom
karpovantonme:docs/build-context-params

Conversation

@karpovantonme

Copy link
Copy Markdown

Description

Two things in the ConversationHistory.build_context docstring do not match the signature.

def build_context(
    self,
    tokenizer: Tokenizer | None = None,
    include_user_turns_only: bool = True,
    max_qa_turns: int | None = 5,
    ...
):
    """
    Parameters
    ----------
        user_queries_only: If True, only user queries ... default is True.
        max_qa_turns: Maximum number of QA turns to include in the context, default is 1.

user_queries_only does not exist, the parameter is include_user_turns_only and that is the name used in the body. And max_qa_turns is documented as defaulting to 1 while the signature says 5, so anyone relying on the docstring gets the truncation point wrong.

Related Issues

None.

Proposed Changes

  • user_queries_only renamed to include_user_turns_only
  • documented default for max_qa_turns corrected from 1 to 5

Checklist

  • I have tested these changes locally. Docstring text only, nothing to run.
  • I have reviewed the code changes.
  • I have updated the documentation (if necessary). This is the documentation.
  • I have added appropriate unit tests (if applicable). Not applicable.

Additional Notes

tokenizer and max_context_tokens are not documented at all, which is a separate thing and I left it alone

The docstring names user_queries_only; the parameter is
include_user_turns_only. It also says max_qa_turns defaults to 1 while
the signature has 5.
@karpovantonme
Anton Karpov (karpovantonme) requested a review from a team as a code owner August 6, 2026 02:04
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