-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: kurtCache handling of schemas - serialize as JSON Schema
Prior to this commit, KurtCache would raise an unhandled YAML serializing exception when storing a cache entry that included structured data, because it was trying to serialize the Zod schema object directly. This commit fixes that problem by converting the schema to JSON schema (which is cleanly serializable) before writing the YAML cache entry.
- Loading branch information
Showing
6 changed files
with
89 additions
and
32 deletions.
There are no files selected for viewing
13 changes: 0 additions & 13 deletions
13
...he/test-retain/stub-ad557ba1818e8013f9e2fbc9598c034e263c96c5fe7edd491e75be8ce450f5c9.yaml
This file was deleted.
Oops, something went wrong.
28 changes: 28 additions & 0 deletions
28
...he/test-retain/stub-b8a5a99fa499ef332c4a599d5b1eff433fc0ee7cd6995e86fb7dbfd8b9ffe999.yaml
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
messages: | ||
- role: user | ||
text: Was this cached? | ||
sampling: | ||
maxOutputTokens: 4096 | ||
temperature: 0.5 | ||
topP: 0.95 | ||
tools: | ||
structured_data: | ||
name: structured_data | ||
description: "" | ||
parameters: | ||
type: object | ||
properties: | ||
cached: | ||
type: boolean | ||
required: | ||
- cached | ||
additionalProperties: false | ||
$schema: http://json-schema.org/draft-07/schema# | ||
forceTool: structured_data | ||
response: | ||
- chunk: '{"cached":' | ||
- chunk: true} | ||
- finished: true | ||
text: '{"cached":true}' | ||
data: | ||
cached: true |
This file contains 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 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 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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.