-
Notifications
You must be signed in to change notification settings - Fork 22k
fix: Tool calling on windows #4234
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
Changes from 1 commit
20aa417
d2ef205
376d6a8
322b732
5de9812
e05e7c3
63fa88b
6aa319e
6f09f43
3b5af86
2601971
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||
|---|---|---|---|---|---|---|---|---|
|
|
@@ -170,18 +170,26 @@ export namespace Storage { | |||||||
| const target = path.join(dir, ...key) + ".json" | ||||||||
| return withErrorHandling(async () => { | ||||||||
| using _ = await Lock.read(target) | ||||||||
| return Bun.file(target).json() as Promise<T> | ||||||||
| const result = await Bun.file(target).json() | ||||||||
| return result as Promise<T> | ||||||||
| }) | ||||||||
| } | ||||||||
|
|
||||||||
| export async function update<T>(key: string[], fn: (draft: T) => void) { | ||||||||
| const dir = await state().then((x) => x.dir) | ||||||||
| const target = path.join(dir, ...key) + ".json" | ||||||||
| return withErrorHandling(async () => { | ||||||||
| using _ = await Lock.write("storage") | ||||||||
| using _ = await Lock.write(target) | ||||||||
| const content = await Bun.file(target).json() | ||||||||
| fn(content) | ||||||||
| await Bun.write(target, JSON.stringify(content, null, 2)) | ||||||||
| const jsonContent = JSON.stringify(content, null, 2) | ||||||||
|
||||||||
| const jsonContent = JSON.stringify(content, null, 2) | |
| const jsonContent = JSON.stringify(content, null, 2) | |
| await fs.mkdir(path.dirname(target), { recursive: true }) |
Uh oh!
There was an error while loading. Please reload this page.