Struct llm_chain_openai::chatgpt::Step
source · pub struct Step { /* private fields */ }
Expand description
The Step
struct represents an individual step within a chain for ChatGPT models. It is responsible for configuring the input parameters for the model and providing the prompt.
By creating a Step
, you can customize the model and prompt used for a particular stage within an llm-chain
workflow. This allows for granular control over the text generation process, enabling you to create sophisticated multi-step chains.
Example
use llm_chain_openai::chatgpt::{Step, Model, ChatPromptTemplate};
let model = Model::ChatGPT3_5Turbo;
let prompt = ChatPromptTemplate::system_and_user("You are an assistant that speaks like Shakespeare.", "tell me a joke");
let chat_gpt_step = Step::new(model, prompt);
Implementations§
Trait Implementations§
source§impl<'de> Deserialize<'de> for Step
impl<'de> Deserialize<'de> for Step
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where __D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more