SmartPrompt
Wisej.AI.SmartPrompt
Last updated
Wisej.AI.SmartPrompt
Last updated
Namespace: Wisej.AI
Assembly: Wisej.AI (3.5.0.0)
Represents a smart prompt component that can process and manage prompts with tools and parameters.
The class provides functionality to manage prompts, tools, and parameters. It supports cloning and asynchronous operations to ask questions using a smart hub or endpoint.
Initializes a new instance of the class with the specified text.
text
The initial text for the prompt. Default is null
.
The prompt dictionaries are loaded from the AI directory and embedded resources.
Asynchronously asks a question using the specified smart hub.
hub
The smart hub to use.
question
The question to ask.
An optional image to include in the question. Default is null
.
Throws:
Asynchronously asks a question using the specified smart endpoint.
endpoint
The smart endpoint to use.
question
The question to ask.
An optional image to include. Default is null
.
Throws:
Removes a tool from the smart prompt.
tool
The tool to remove.
Throws:
Removes the tools from the specified object.
target
The target object containing tools.
Resolves the prompt text for the specified key.
key
The key to resolve.
Saves the prompts to the specified file path.
filePath
The file path to save the prompts to.
Adds a tool to the smart prompt.
tool
The tool to add.
Throws:
Uses the tools from the specified target object.
target
The target object containing tools.
TODO:
Represents a smart parallel prompt that can execute multiple tasks concurrently.
Represents a provider that supplies tools.
: Gets the collection of prompt dictionaries.
: Gets or sets the text of the smart prompt. (Default: null
)
The text is resolved using the method.
image
Returns: . A task representing the asynchronous operation, with a result.
Thrown when the hub or question is null.
image
Returns: . A task representing the asynchronous operation, with a result.
Thrown when the endpoint or question is null.
Creates a new instance of the class that is a copy of the current instance.
Returns: . A new object that is a copy of this instance.
Returns: . The current instance.
Thrown when the tool is null.
Returns: . The current instance.
Returns: . The resolved prompt text, or the key if not found.
Returns: . The current instance.
Thrown when the tool is null.
Returns: . The current instance.