From 7d06afa1b475b49f2bacb76522ad60781d85a298 Mon Sep 17 00:00:00 2001 From: Jacques Verre Date: Sat, 23 Nov 2024 22:19:20 +0000 Subject: [PATCH] Fix failing tests --- sdks/python/examples/openai_integration_example.py | 6 +++++- sdks/python/tests/library_integration/openai/test_openai.py | 3 ++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/sdks/python/examples/openai_integration_example.py b/sdks/python/examples/openai_integration_example.py index 09b93689b3..64675cf3dd 100644 --- a/sdks/python/examples/openai_integration_example.py +++ b/sdks/python/examples/openai_integration_example.py @@ -10,6 +10,7 @@ client = opik_tracker.track_openai(client) + @track() def f_with_structured_output_openai_call(): class CalendarEvent(BaseModel): @@ -21,7 +22,10 @@ class CalendarEvent(BaseModel): model="gpt-4o-2024-08-06", messages=[ {"role": "system", "content": "Extract the event information."}, - {"role": "user", "content": "Alice and Bob are going to a science fair on Friday."}, + { + "role": "user", + "content": "Alice and Bob are going to a science fair on Friday.", + }, ], response_format=CalendarEvent, ) diff --git a/sdks/python/tests/library_integration/openai/test_openai.py b/sdks/python/tests/library_integration/openai/test_openai.py index cdec5d6347..d46c3a47ec 100644 --- a/sdks/python/tests/library_integration/openai/test_openai.py +++ b/sdks/python/tests/library_integration/openai/test_openai.py @@ -3,6 +3,7 @@ import os import asyncio from pydantic import BaseModel +from typing import List import opik from opik.integrations.openai import track_openai @@ -511,7 +512,7 @@ def test_openai_client_beta_chat_completions_parse__happyflow( class CalendarEvent(BaseModel): name: str date: str - participants: list[str] + participants: List[str] messages = [ {"role": "system", "content": "Extract the event information."},