Files
AI/참고/instructor-main/tests/test_multitask.py

19 lines
498 B
Python
Raw Normal View History

2026-05-12 19:40:31 +09:00
from instructor import OpenAISchema
from instructor.dsl import IterableModel
from typing import cast
def test_multi_task():
class Search(OpenAISchema):
"""This is the search docstring"""
id: int
query: str
IterableSearch = cast(type[OpenAISchema], IterableModel(Search))
assert IterableSearch.openai_schema["name"] == "IterableSearch"
assert (
IterableSearch.openai_schema["description"]
== "Correct segmentation of `Search` tasks"
)