mirror of
https://github.com/Mintplex-Labs/abitat.git
synced 2026-07-01 10:05:27 -04:00
fix bug where it would thrown errors when model provided wrong JSON
This commit is contained in:
@@ -0,0 +1,5 @@
|
||||
---
|
||||
'aibitat': patch
|
||||
---
|
||||
|
||||
fix bug where it would thrown errors when model provided wrong JSON
|
||||
@@ -241,8 +241,8 @@ export class OpenAIProvider extends AIProvider<OpenAI> {
|
||||
try {
|
||||
json = JSON.parse(call.arguments)
|
||||
} catch (error) {
|
||||
throw new Error(
|
||||
`Model created an invalid JSON: '${call.arguments}' for function '${call.name}'`,
|
||||
return Promise.resolve(
|
||||
`Invalid JSON parameters: ${(error as Error).message}`,
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user