You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
tools to issue invoices, create rules, send emails, and a few others.
Read more about SGR: http://abdullin.com/schema-guided-reasoning/
THis demo is described in: https://abdullin.com/schema-guided-reasoning/demo
This demo is described in more detail here: https://abdullin.com/schema-guided-reasoning/demo
"""
@@ -33,9 +34,9 @@
},
}
# Now, let's define a few tools which could be used by LLM to do something useful with this customer management system. We need tools to issue invoices, send emails, create rules and memorize new rules. Maybe a tool to cancel invoices.
# To be precise, each tool will be a command (as in CQRS/DDD world), phrased as an instruction and coming with a list of valid arguments
# Now, let's define a few tools which could be used by LLM to do something
# useful with this customer management system. We need tools to issue invoices,
# send emails, create rules and memorize new rules. Maybe a tool to cancel invoices.
fromtypingimportList, Union, Literal, Annotated
fromannotated_typesimportMaxLen, Le, MinLen
@@ -50,22 +51,6 @@ class SendEmail(BaseModel):
files: List[str]
recipient_email: str
# This command is equivalent to a function declaration that looks like:
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Now, let's define a few tools which could be used by LLM to do something useful with this customer management system. We need tools to issue invoices, send emails, create rules and memorize new rules. Maybe a tool to cancel invoices.
# To be precise, each tool will be a command (as in CQRS/DDD world), phrased as an instruction and coming with a list of valid arguments
fromtypingimportList, Union, Literal, Annotated
fromannotated_typesimportMaxLen, Le, MinLen
frompydanticimportBaseModel, Field
# Tool: Sends an email with subject, message, attachments to a recipient
classSendEmail(BaseModel):
tool: Literal["send_email"]
subject: str
message: str
files: List[str]
recipient_email: str
# This command is equivalent to a function declaration that looks like: