Make WorkflowStepResolution an entity (#16268)
This PR is just a refactor, to pave the way toward adding a view for workflow step resolution. The entity carries the state of the tool call's streaming output. Release Notes: - N/A
This commit is contained in:
parent
102796979b
commit
e0cabbd142
6 changed files with 753 additions and 725 deletions
|
@ -99,6 +99,16 @@ impl dyn LanguageModel {
|
|||
Ok(serde_json::from_str(&response)?)
|
||||
}
|
||||
}
|
||||
|
||||
pub fn use_tool_stream<T: LanguageModelTool>(
|
||||
&self,
|
||||
request: LanguageModelRequest,
|
||||
cx: &AsyncAppContext,
|
||||
) -> BoxFuture<'static, Result<BoxStream<'static, Result<String>>>> {
|
||||
let schema = schemars::schema_for!(T);
|
||||
let schema_json = serde_json::to_value(&schema).unwrap();
|
||||
self.use_any_tool(request, T::name(), T::description(), schema_json, cx)
|
||||
}
|
||||
}
|
||||
|
||||
pub trait LanguageModelTool: 'static + DeserializeOwned + JsonSchema {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue