Skip to content

Appending description to the return type fields when calling models #851

Open
@monilgandhi

Description

@monilgandhi

Currently, I have a expected return type from the models.

class Weather(TypedDict):
 weather_description: str = Field(description="Write a nice description if weather anything but sunny. If it is sunny, leave it empty")

When I looked at the prompt that is finally sent to open ai, I saw that the fields are converted to below format

                    "properties": {
                        "weather_description": {
                            "title": "Weather Description",
                            "type": "string"
                        }

I was wondering if there a way I can append the description of the field to the translated schema.
Currently I am just appending it to my system prompt. I have seen that (in openai atleast) the model respects the schema descriptions.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions