@@ -393,7 +393,7 @@ def _overwrite_completion_methods(self) -> None:
393
393
)
394
394
self .openai_client .completions .create = self .modified_create_completion
395
395
396
- def monitor_thread_run (self , run : openai .types .beta .threads .run .Run ) -> None :
396
+ def monitor_thread_run (self , run : " openai.types.beta.threads.run.Run" ) -> None :
397
397
"""Monitor a run from an OpenAI assistant.
398
398
399
399
Once the run is completed, the thread data is published to Openlayer,
@@ -428,13 +428,13 @@ def monitor_thread_run(self, run: openai.types.beta.threads.run.Run) -> None:
428
428
except Exception as e :
429
429
print (f"Failed to monitor run. { e } " )
430
430
431
- def _type_check_run (self , run : openai .types .beta .threads .run .Run ) -> None :
431
+ def _type_check_run (self , run : " openai.types.beta.threads.run.Run" ) -> None :
432
432
"""Validate the run object."""
433
433
if not isinstance (run , openai .types .beta .threads .run .Run ):
434
434
raise ValueError (f"Expected a Run object, but got { type (run )} ." )
435
435
436
436
def _extract_run_vars (
437
- self , run : openai .types .beta .threads .run .Run
437
+ self , run : " openai.types.beta.threads.run.Run"
438
438
) -> Dict [str , any ]:
439
439
"""Extract the variables from the run object."""
440
440
return {
@@ -453,7 +453,7 @@ def _extract_run_vars(
453
453
}
454
454
455
455
def _extract_run_metadata (
456
- self , run : openai .types .beta .threads .run .Run
456
+ self , run : " openai.types.beta.threads.run.Run"
457
457
) -> Dict [str , any ]:
458
458
"""Extract the metadata from the run object."""
459
459
return {
@@ -463,7 +463,7 @@ def _extract_run_metadata(
463
463
464
464
@staticmethod
465
465
def thread_messages_to_prompt (
466
- messages : List [openai .types .beta .threads .thread_message .ThreadMessage ],
466
+ messages : List [" openai.types.beta.threads.thread_message.ThreadMessage" ],
467
467
) -> List [Dict [str , str ]]:
468
468
"""Given list of ThreadMessage, return its contents in the `prompt` format,
469
469
i.e., a list of dicts with 'role' and 'content' keys."""
0 commit comments