-
Notifications
You must be signed in to change notification settings - Fork 11
Issue 268 - Support for tool calls #305
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
Conversation
README.md
Outdated
@@ -539,6 +539,136 @@ val jsonSchema: ASchema = TapirSchemaToJsonSchema( | |||
) | |||
``` | |||
|
|||
#### Generating JSON Schema from case class | |||
|
|||
We can also generate JSON Schema directly from case class, without defining the schema manually: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would expand this a bit:
- some more detail on how this differs from the example immediately above
- first mention the methods that the section focuses on (as I understand, this is about
SchematizedFunctionTool
?), describe how this works, and only later proceed to the example. The example is long and it might be hard understanding what's the main point
|
||
val initialRequestMessage = Seq(UserMessage(content = TextContent("I want to book a flight from London to Tokyo for Jane Doe, age 34"))) | ||
|
||
val givenRequest = ChatBody( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
let's add some comments here describing how this differs from a "normal" open ai request, and what amount of labor we are saving
) | ||
*/ | ||
|
||
val toolCalls = initialRequestResult.choices.head.message.toolCalls |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
here again, some context on what you're trying to achieve with that code would be good. Also earlier: what functionality are you implementing in the example? What are the actors? There's a user which specifies the prompt, there's ChatGPT, and there's a booking service - it would be good to introduce them first
@@ -16,6 +20,31 @@ object Tool { | |||
*/ | |||
case class FunctionTool(description: String, name: String, parameters: Map[String, Value]) extends Tool | |||
|
|||
case class SchematizedFunctionTool(description: String, name: String, parameters: Schema) extends Tool |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
some scalados here would be nice, specifying when to use FuntionTool
, and when this class, and in which API
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, let's merge & release :)
Co-authored-by: Adam Warski <[email protected]>
No description provided.