Clean up doc comments on LanguageModelTool
trait (#11217)
This PR cleans up the doc comments on the `LanguageModelTool` trait to follow Rust documentation conventions. Release Notes: - N/A
This commit is contained in:
parent
e3de440715
commit
713c314d67
1 changed files with 10 additions and 7 deletions
|
@ -70,16 +70,19 @@ pub trait LanguageModelTool {
|
||||||
|
|
||||||
type View: Render;
|
type View: Render;
|
||||||
|
|
||||||
/// The name of the tool is exposed to the language model to allow
|
/// Returns the name of the tool.
|
||||||
/// the model to pick which tools to use. As this name is used to
|
///
|
||||||
/// identify the tool within a tool registry, it should be unique.
|
/// This name is exposed to the language model to allow the model to pick
|
||||||
|
/// which tools to use. As this name is used to identify the tool within a
|
||||||
|
/// tool registry, it should be unique.
|
||||||
fn name(&self) -> String;
|
fn name(&self) -> String;
|
||||||
|
|
||||||
/// A description of the tool that can be used to _prompt_ the model
|
/// Returns the description of the tool.
|
||||||
/// as to what the tool does.
|
///
|
||||||
|
/// This can be used to _prompt_ the model as to what the tool does.
|
||||||
fn description(&self) -> String;
|
fn description(&self) -> String;
|
||||||
|
|
||||||
/// The OpenAI Function definition for the tool, for direct use with OpenAI's API.
|
/// Returns the OpenAI Function definition for the tool, for direct use with OpenAI's API.
|
||||||
fn definition(&self) -> ToolFunctionDefinition {
|
fn definition(&self) -> ToolFunctionDefinition {
|
||||||
let root_schema = schema_for!(Self::Input);
|
let root_schema = schema_for!(Self::Input);
|
||||||
|
|
||||||
|
@ -90,7 +93,7 @@ pub trait LanguageModelTool {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Execute the tool
|
/// Executes the tool with the given input.
|
||||||
fn execute(&self, input: &Self::Input, cx: &AppContext) -> Task<Result<Self::Output>>;
|
fn execute(&self, input: &Self::Input, cx: &AppContext) -> Task<Result<Self::Output>>;
|
||||||
|
|
||||||
fn format(input: &Self::Input, output: &Result<Self::Output>) -> String;
|
fn format(input: &Self::Input, output: &Result<Self::Output>) -> String;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue