Skip to content

Commit

Permalink
Refactor chat response handling to directly use message content for M…
Browse files Browse the repository at this point in the history
…ofaAgentResult (#353)
  • Loading branch information
joulei authored Jan 21, 2025
1 parent a63dd44 commit bf96297
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/data/chats/chat.rs
Original file line number Diff line number Diff line change
Expand Up @@ -428,12 +428,10 @@ impl Chat {
std::thread::spawn(move || '_loop: loop {
match rx.recv() {
Ok(moly_mofa::ChatResponse::ChatFinalResponseData(data)) => {
let node_results = serde_json::from_str::<MofaAgentResponse>(&data.choices[0].message.content).unwrap();
let content = data.choices[0].message.content.clone();
Cx::post_action(ChatEntityAction {
chat_id,
kind: ChatEntityActionKind::MofaAgentResult(
node_results.node_results
),
kind: ChatEntityActionKind::MofaAgentResult(content),
});

break '_loop;
Expand Down

0 comments on commit bf96297

Please sign in to comment.