fix: correct typos and GetWeather unit handling in tool examples#298
Closed
frankgoldfish wants to merge 1 commit intoanthropics:mainfrom
Closed
fix: correct typos and GetWeather unit handling in tool examples#298frankgoldfish wants to merge 1 commit intoanthropics:mainfrom
frankgoldfish wants to merge 1 commit intoanthropics:mainfrom
Conversation
Three issues fixed across the tools example files: 1. 'farenheit' -> 'fahrenheit' (misspelled in GetTemperatureUnit return value and GetWeather response, but the tool schema enum used the correct spelling, causing a mismatch between the schema and the mock implementation) 2. 'lattitude' -> 'latitude' (double-t typo in tool input description) 3. GetWeather now returns the unit parameter instead of a hardcoded string, so the response is consistent with whatever unit the model requested
Author
|
Closing this PR — found that PR #260 already addresses this issue. Apologies for the duplicate. |
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.
Summary
Fixes three related issues in the weather tool mock implementations across
examples/tools/,examples/tools-streaming/, andexamples/tools-streaming-jsonschema/:farenheit→fahrenheit— The return value ofGetTemperatureUnitand theUnitfield inGetWeatherwere misspelled. The tool schema enum correctly uses"fahrenheit", so the mock was returning a value that doesn't match the declared enum.lattitude→latitude— Double-t typo in the tool input description for thelatfield intools/andtools-streaming/examples.GetWeathernow returns theunitparameter — The function accepted aunit stringargument but ignored it, always returning the hardcoded (misspelled) string. It now echoes back the requested unit.Test plan
GetTemperatureUnitreturns"fahrenheit"(matches the schema enum)GetWeatherreturns theunitparameter value (consistent with what the model requested)🤖 Generated with Claude Code