Skip to content

Commit

Permalink
chore: v2 stream message
Browse files Browse the repository at this point in the history
  • Loading branch information
appflowy committed Aug 12, 2024
1 parent 71d5bf4 commit 4d9d47b
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion appflowy-local-ai/src/ai_ops.rs
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,10 @@ impl ResponseParser for ChatStreamResponseV2Parser {
type ValueType = serde_json::Value;

fn parse_json(json: JsonValue) -> Result<Self::ValueType, RemoteError> {
Ok(json)
json
.as_str()
.and_then(|s| serde_json::from_str(s).ok())
.ok_or(RemoteError::ParseResponse(json))
}
}

Expand Down

0 comments on commit 4d9d47b

Please sign in to comment.