Skip to content

Conversation

zygiert1990
Copy link
Contributor

No description provided.

@zygiert1990 zygiert1990 self-assigned this Mar 21, 2025
@zygiert1990 zygiert1990 requested a review from adamw March 24, 2025 09:50
@zygiert1990 zygiert1990 marked this pull request as ready for review March 24, 2025 09:50
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:
Copy link
Member

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(
Copy link
Member

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
Copy link
Member

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
Copy link
Member

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

@zygiert1990 zygiert1990 requested a review from adamw March 25, 2025 05:32
Copy link
Member

@adamw adamw left a 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 :)

zygiert1990 and others added 2 commits March 25, 2025 09:50
@zygiert1990 zygiert1990 merged commit 59f7688 into master Mar 25, 2025
9 checks passed
@zygiert1990 zygiert1990 deleted the issue-268 branch March 25, 2025 08:55
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.

2 participants