Skip to content

Commit

Permalink
using Field
Browse files Browse the repository at this point in the history
  • Loading branch information
zby committed Sep 30, 2024
1 parent 1949ea0 commit a62f53a
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions examples/response_format_structured_output.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from prompete import Chat
from pydantic import BaseModel
from pydantic import BaseModel, Field
from pprint import pprint


Expand All @@ -11,7 +11,7 @@ class Address(BaseModel):
class Company(BaseModel):
name: str
specialty: str
address: Address
address: Address = Field(..., description='The address of the company headquarters') # Address of the company headquarters


class CompaniesList(BaseModel):
Expand All @@ -29,6 +29,8 @@ def print_companies(self):

# model = "claude-3-haiku-20240307" # Currently Anthropic does not support response_format - but we emulate it by using tools
#model="ollama_chat/llama3:instruct"
#model = "ollama_chat/llama3.1:8b-instruct-q8_0"

model = "gpt-4o-mini"
chat = Chat(model=model, emulate_response_format=True)

Expand Down

0 comments on commit a62f53a

Please sign in to comment.