Commit 64ed167 1 parent bcedafc commit 64ed167 Copy full SHA for 64ed167
File tree 1 file changed +7
-2
lines changed
nerve-core/src/agent/generator
1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -267,10 +267,15 @@ impl Client for GroqClient {
267
267
let mut payload = None ;
268
268
269
269
if let Some ( args) = call. function . arguments . as_ref ( ) {
270
- let map: HashMap < String , String > = serde_json:: from_str ( args) ?;
270
+ let map: HashMap < String , serde_json :: Value > = serde_json:: from_str ( args) ?;
271
271
272
272
for ( name, value) in map {
273
- let str_val = value. to_string ( ) . trim_matches ( '"' ) . to_string ( ) ;
273
+ let mut content = value. to_string ( ) ;
274
+ if let serde_json:: Value :: String ( escaped_json) = & value {
275
+ content = escaped_json. to_string ( ) ;
276
+ }
277
+
278
+ let str_val = content. trim_matches ( '"' ) . to_string ( ) ;
274
279
if name == "payload" {
275
280
payload = Some ( str_val) ;
276
281
} else {
You can’t perform that action at this time.
0 commit comments