diff --git a/langfun/core/structured/completion_test.py b/langfun/core/structured/completion_test.py index 88a87dc..44e4581 100644 --- a/langfun/core/structured/completion_test.py +++ b/langfun/core/structured/completion_test.py @@ -30,7 +30,10 @@ class Activity(pg.Object): class Itinerary(pg.Object): day: pg.typing.Int[1, None] - type: pg.typing.Enum['daytime', 'nighttime'] + type: pg.typing.Annotated[ + pg.typing.Enum['daytime', 'nighttime'], + 'Type of itinerary.' + ] activities: list[Activity] hotel: pg.typing.Str['.*Hotel'] | None @@ -73,18 +76,21 @@ def test_render_no_examples(self): itineraries=[ Itinerary( day=1, + # Type of itinerary. type=MISSING(Literal['daytime', 'nighttime']), activities=MISSING(list[Activity]), hotel=None ), Itinerary( day=2, + # Type of itinerary. type=MISSING(Literal['daytime', 'nighttime']), activities=MISSING(list[Activity]), hotel=None ), Itinerary( day=3, + # Type of itinerary. type=MISSING(Literal['daytime', 'nighttime']), activities=MISSING(list[Activity]), hotel=None @@ -134,6 +140,7 @@ def test_render_no_class_definitions(self): itineraries=[ Itinerary( day=1, + # Type of itinerary. type=MISSING(Literal['daytime', 'nighttime']), activities=[ Activity( @@ -144,6 +151,7 @@ def test_render_no_class_definitions(self): ), Itinerary( day=2, + # Type of itinerary. type=MISSING(Literal['daytime', 'nighttime']), activities=[ Activity( @@ -154,6 +162,7 @@ def test_render_no_class_definitions(self): ), Itinerary( day=3, + # Type of itinerary. type=MISSING(Literal['daytime', 'nighttime']), activities=[ Activity( @@ -238,18 +247,21 @@ class _Date: itineraries=[ Itinerary( day=1, + # Type of itinerary. type=MISSING(Literal['daytime', 'nighttime']), activities=MISSING(list[Activity]), hotel=None ), Itinerary( day=2, + # Type of itinerary. type=MISSING(Literal['daytime', 'nighttime']), activities=MISSING(list[Activity]), hotel=None ), Itinerary( day=3, + # Type of itinerary. type=MISSING(Literal['daytime', 'nighttime']), activities=MISSING(list[Activity]), hotel=None diff --git a/langfun/core/structured/mapping.py b/langfun/core/structured/mapping.py index 206c0aa..61f932b 100644 --- a/langfun/core/structured/mapping.py +++ b/langfun/core/structured/mapping.py @@ -379,7 +379,8 @@ def input_value(self) -> Any: return schema_lib.mark_missing(self.message.result) def value_str(self, value: Any) -> str: - return schema_lib.value_repr('python').repr(value, compact=False) + return schema_lib.value_repr('python').repr( + value, compact=False, verbose=True) def missing_type_dependencies(self, value: Any) -> list[Type[Any]]: value_specs = tuple( diff --git a/requirements.txt b/requirements.txt index 0a192cf..56d4057 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,5 +1,5 @@ jinja2>=3.1.2 openai==0.27.2 -pyglove>=0.4.4.dev20230926 +pyglove>=0.4.4.dev20231006 termcolor==1.1.0 tqdm>=4.64.1 \ No newline at end of file