Skip to content

Conversation

Durbatuluk1701
Copy link

Not sure if you are wanting/accepting PRs, but I've found this reply_in_json_interface prompting utility to work well.

I noticed that reply_in_json was not yielding great results for my testing (notably on smaller models), as the model would occasionally ignore required interface fields or not respond with valid json.

This instead gives a more concrete, typescript style interface that the models seem to follow more consistently.

Example

class Address(BaseModel):
    street: str = Field(description="Street name and number")
    city: str
    zip_code: str

x = Address(....)
reply_in_json_interface(x)

yields:

Reply with the following JSON interface:
```
{
    street : string; // Street name and number
    city : string;
    zip_code : string;
}
```

… (modify agent example to use reply_in_json_interface)
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

Successfully merging this pull request may close these issues.

1 participant