19 lines
498 B
Python
19 lines
498 B
Python
|
|
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"
|
||
|
|
)
|