MCPcopy
hub / github.com/llmware-ai/llmware / Prompt

Class Prompt

llmware/prompts.py:44–1261  ·  view source on GitHub ↗

Implements the actions of the prompt process, which includes the actions pre-processing, execution, post-processing, and managing the state of related inferences. ``Prompt`` is responsible for pre-processing, executing, and post-processing of inferences and for managing end-to-end state

Source from the content-addressed store, hash-verified

42
43
44class Prompt:
45
46 """Implements the actions of the prompt process, which includes the actions pre-processing, execution,
47 post-processing, and managing the state of related inferences.
48
49 ``Prompt`` is responsible for pre-processing, executing, and post-processing of inferences and for
50 managing end-to-end state of a series of related inferences.
51
52 Parameters
53 ----------
54 llm_name : str, default=None
55 The name of the llm to be used.
56
57 tokenizer : object, default=None
58 The tokenizer to use. The default is to use the tokenizer specified by the ``Utilities`` class.
59
60 model_card : dict, default=None
61 A dictionary describing the model to be used. If the dictionary contains the key ``model_name``,
62 then this model will be used instead of the one set by ``llm_name``. In other words, ``model_card``
63 overrides ``llm_name``.
64
65 library : object, default=None
66 A ``Library`` object.
67
68 account_name : str, default="llmware"
69 The name of the account to be used. This is one of the attributes of the prompt.
70
71 prompt_id : int, default=None
72 The ID of the prompt. If a prompt ID is given, then the state of this prompt is loaded. Otherwise, a
73 new prompt ID is generated. This is part of the state of a prompt.
74
75 save_state : bool, default=True
76 Actually, this is a dead variable and should be removed in a future release.
77
78 llm_api_key : str, default=None
79 The API key that is used to load the large language model.
80
81 llm_model : str, default=None
82 The name of the model to load.
83
84 from_hf : bool, default=False
85 Indicates whether the model should be loaded from hugging face.
86
87 prompt_catalog : object, default=None
88 An object of type ``PromptCatalog``.
89
90 temperature : float, default=0.5
91 Sets the temperature of the large language model.
92
93 prompt_wrapper : str, default="human_bot"
94 Sets the prompt wrapper. Possible values are "alpaca", "human_bot", "chatgpt", "<INST>", "open_chat",
95 "hf_chat", and "chat_ml".
96
97 instruction_following : bool, default=False
98 Sets whether the large language model should follow instructions. Note that this has an effect
99 if and only if the model specified has a version that is trained to follow instructions.
100
101 """

Callers 15

ragFunction · 0.90
msa_processingFunction · 0.90
invoice_processingFunction · 0.90
load_prompt_modelFunction · 0.90
summarize_fileFunction · 0.90
prompt_general_questionFunction · 0.90
model_test_run_generalFunction · 0.90
step6_simple_use_caseFunction · 0.90

Calls

no outgoing calls

Tested by 11

model_test_run_generalFunction · 0.72
test_summarize_documentFunction · 0.72
test_summarize_documentFunction · 0.72
run_testFunction · 0.72
run_testFunction · 0.72
test_openaiFunction · 0.72
test_googleFunction · 0.72
test_anthropicFunction · 0.72
test_ai21Function · 0.72
load_modelsFunction · 0.72