docs: fix stale ModelAPI docstrings (nonexistent api_key_vars / ChatUserMessage) - #1634
Merged
Merged
Conversation
- ModelAPI.__init__ documented an `api_key_vars` parameter that does not exist in the signature or anywhere else in the codebase - ModelAPI.generate documented `input` as `str | list[ChatMessage]`, but the signature only accepts `list[ChatMessage]`; the str conversion happens in Model._preprocess_input, and the referenced `ChatUserMessage` class does not exist (the actual class is `ChatMessageUser`) Co-authored-by: Claude <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Two stale docstrings in the
ModelAPIbase class describe an API that does not exist:ModelAPI.__init__documents anapi_key_varsparameter that is not in thesignature.
grep -rn "api_key_vars"matches only this docstring — theparameter does not exist anywhere in the codebase.
ModelAPI.generatedocumentsinputasstr | list[ChatMessage]and claims astris converted to aChatUserMessage. But:input: List[ChatMessage]and does not acceptstr;str-> message conversion happens one layer up inModel._preprocess_input,not in this base class;
ChatUserMessagedoes not exist; the actual class isChatMessageUser(433 occurrences), so the name in the docstring is wrong as well.
Both appear to be leftovers from the upstream inspect-ai API.
Test
Docstring only, no behavior change.
make lintequivalents pass:ruff check evalscope/api/model/model.pyreports no newfindings vs. the unmodified baseline;
yapf --diff-> emptypython -m py_compilepassesdocs/{zh,en}/benchmarks/,evalscope/benchmarks/_meta/)