Skip to content

Commit 6f2e5a4

Browse files
committed
Address PR review: nullable tool params, fix year, fix Spanish typos
1 parent f26cc69 commit 6f2e5a4

9 files changed

Lines changed: 14 additions & 15 deletions

function_calling_call.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,11 +44,11 @@ def lookup_weather(city_name=None, zip_code=None):
4444
"type": "object",
4545
"properties": {
4646
"city_name": {
47-
"type": "string",
47+
"type": ["string", "null"],
4848
"description": "The city name",
4949
},
5050
"zip_code": {
51-
"type": "string",
51+
"type": ["string", "null"],
5252
"description": "The zip code",
5353
},
5454
},

function_calling_extended.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,11 +48,11 @@ def lookup_weather(city_name=None, zip_code=None):
4848
"type": "object",
4949
"properties": {
5050
"city_name": {
51-
"type": "string",
51+
"type": ["string", "null"],
5252
"description": "The city name",
5353
},
5454
"zip_code": {
55-
"type": "string",
55+
"type": ["string", "null"],
5656
"description": "The zip code",
5757
},
5858
},

spanish/chat.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,5 +37,5 @@
3737
store=False,
3838
)
3939

40-
print(f"Repuesta de {API_HOST}: \n")
40+
print(f"Respuesta de {API_HOST}: \n")
4141
print(response.output_text)

spanish/few_shot_examples.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,5 +53,5 @@
5353
)
5454

5555

56-
print(f"Repuesta de {API_HOST}: \n")
56+
print(f"Respuesta de {API_HOST}: \n")
5757
print(response.output_text)

spanish/function_calling_call.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,11 +44,11 @@ def lookup_weather(city_name=None, zip_code=None):
4444
"type": "object",
4545
"properties": {
4646
"city_name": {
47-
"type": "string",
47+
"type": ["string", "null"],
4848
"description": "El nombre de la ciudad",
4949
},
5050
"zip_code": {
51-
"type": "string",
51+
"type": ["string", "null"],
5252
"description": "El código postal",
5353
},
5454
},

spanish/function_calling_extended.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,11 +48,11 @@ def lookup_weather(city_name=None, zip_code=None):
4848
"type": "object",
4949
"properties": {
5050
"city_name": {
51-
"type": "string",
51+
"type": ["string", "null"],
5252
"description": "The city name",
5353
},
5454
"zip_code": {
55-
"type": "string",
55+
"type": ["string", "null"],
5656
"description": "The zip code",
5757
},
5858
},

spanish/rag_csv.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,5 +68,5 @@
6868
store=False,
6969
)
7070

71-
print(f"\nRespuest de {API_HOST}: \n")
71+
print(f"\nRespuesta de {API_HOST}: \n")
7272
print(response.output_text)

spanish/structured_outputs_description.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,14 +40,14 @@ class CalendarEvent(BaseModel):
4040
input=[
4141
{
4242
"role": "system",
43-
"content": "Extrae la info del evento. Si no dice el año, asumí que es este año (2025).",
43+
"content": "Extrae la info del evento. Si no dice el año, asumí que es este año (2026).",
4444
},
4545
{"role": "user", "content": "Alice y Bob van a ir a una feria de ciencias el 1 de abril."},
4646
],
4747
text_format=CalendarEvent,
4848
store=False,
4949
)
50-
CalendarEvent(name="Feria de Ciencias", date="2025-04-01", participants=["Alice", "Bob"])
50+
5151
if completion.output_parsed:
5252
event = completion.output_parsed
5353
rich.print(event)

structured_outputs_description.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,14 +40,13 @@ class CalendarEvent(BaseModel):
4040
input=[
4141
{
4242
"role": "system",
43-
"content": "Extract the event information. If no year is specified, assume the current year (2025).",
43+
"content": "Extract the event information. If no year is specified, assume the current year (2026).",
4444
},
4545
{"role": "user", "content": "Alice and Bob are going to a science fair on the 1st of april."},
4646
],
4747
text_format=CalendarEvent,
4848
store=False,
4949
)
50-
CalendarEvent(name="Science Fair", date="2025-04-01", participants=["Alice", "Bob"])
5150

5251
if completion.output_parsed:
5352
event = completion.output_parsed

0 commit comments

Comments
 (0)