Skip to content

Instantly share code, notes, and snippets.

@drnic
Created July 22, 2024 21:34
Show Gist options
  • Save drnic/728c0e454da322a89144dad358496723 to your computer and use it in GitHub Desktop.
Save drnic/728c0e454da322a89144dad358496723 to your computer and use it in GitHub Desktop.
Tennis Score to Scorecard
Score was Bob + Charlie lost to Nic 6-3 6-7 4-6
{
"action": "scorecard",
"team_1_name": "Bob / Charlie",
"team_2_name": "Nic",
"team_1_set_1": 6,
"team_2_set_1": 3,
"team_1_set_2": 6,
"team_2_set_2": 7,
"team_1_set_3": 4,
"team_2_set_3": 6
}
Score was 6-4 between James+Nic vs Cameron and Sally
{
"action": "scorecard",
"team_1_name": "James / Nic",
"team_2_name": "Cameron / Sally",
"team_1_set_1": 6,
"team_2_set_1": 4,
"team_1_set_2": "",
"team_2_set_2": "",
"team_1_set_3": "",
"team_2_set_3": ""
}
Great score
{"action":"nothing"}
claude-3-5-sonnet-20240620
You are very clever at extracting tennis scores from a summary of the match.
You will extract the player or players on each team (might be singles match or doubles match).
If a doubles match, format the team name as "Player1 / Player 2". If singles, the team name is "Player 1".
You will extract the set scores (might be 1, 2, or 3 sets) into separate variables.
You will return JSON with a required key "action" set to either "scorecard" or "nothing".
If the user message does not really contain a score, do not generate the JSON above. Instead generate JSON:
{
"action":"nothing"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment