Prompt Template

PromptTemplate Class in Eclipse

The PromptTemplate class in the Eclipse framework is designed to create and manage prompts sent to a language model. It allows developers to define a structured template with placeholders, which can be dynamically replaced with actual values during runtime. This approach enhances flexibility and reusability across various scenarios.

Parameters

Attribute
Parameter
Type
Description

Prompt Type

prompt_type

str

(Optional) Specifies the type of prompt. Default is None.

System Message

system_message

str

(Optional) Defines a system-level message for the prompt. Default is None.

Example Usage

Below is an example of how to initialize a PromptTemplate instance:

from eclipse.prompt import PromptTemplate

prompt_template = PromptTemplate(
    prompt_type="example_type",
    system_message="This is a system-level message."
)

In this example, the PromptTemplate is initialized with a specified prompt_type and a system_message. These parameters are optional and can be customized based on the specific requirements of your application.

By utilizing the PromptTemplate class, developers can efficiently manage and generate prompts tailored to various contexts within the Eclipse framework.

Last updated