Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
monilgandhi opened this issue Feb 5, 2025 · 1 comment
Open

Comments

@monilgandhi
Copy link

monilgandhi commented Feb 5, 2025

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.

@HamzaFarhan
Copy link

The description does get included if you use BaseModel instead of TypedDict.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants