Skip to content
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

fix: capture anthropic model name from response #1124

Merged
merged 2 commits into from
Nov 20, 2024

Conversation

RogerHYang
Copy link
Contributor

when the model argument is latest, we should record the actual model name from the response

Screenshot 2024-11-16 at 12 14 22 PM

@RogerHYang RogerHYang requested a review from a team as a code owner November 16, 2024 20:31
@dosubot dosubot bot added the size:S This PR changes 10-29 lines, ignoring generated files. label Nov 16, 2024
if model_name := arguments.get("model"):
yield LLM_MODEL_NAME, model_name


def _get_llm_model(message: "Message") -> Iterator[Tuple[str, Any]]:
Copy link
Contributor

Choose a reason for hiding this comment

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

little confused by the stuff above, when does one get used and when does the other get used?

Copy link
Contributor Author

@RogerHYang RogerHYang Nov 19, 2024

Choose a reason for hiding this comment

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

The argument version is always available, but it may have an alias like latest. On the other hand the true value (with the actual version numbers) may not be available if we did not get a response e.g. due to network issues. So here we'll first set the argument value regardless, and then replace it later with the true value from the response when the response arrives.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

i have renamed them for better clarity

@RogerHYang RogerHYang merged commit 8e915f2 into main Nov 20, 2024
3 checks passed
@RogerHYang RogerHYang deleted the capture-model-from-response branch November 20, 2024 17:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
size:S This PR changes 10-29 lines, ignoring generated files.
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

3 participants