-
Notifications
You must be signed in to change notification settings - Fork 567
Closed
Labels
Description
Describe the bug
- renderPrompt requires model which negates the point of defining it within definePrompt
- defineDotPrompt is missing features
To Reproduce
Steps to reproduce the behavior:
1.
definePrompt(
{
name: 'helloGetNamePrompt',
inputSchema: z.object({
response: z.string(),
retryCount: z.number().default(0),
argTools: z.record(z.string(), z.any()),
argHistory: z.array(z.record(z.string(), z.any())),
argReturnToolRequests: z.boolean(),
}),
},
async (input) => {
const basePrompt = `Hello!?`;
const retryPrompt = `We previously asked. You answered {{input.response}} Could you please provide your again?`;
const promptText = input.retryCount > 0 ? retryPrompt : basePrompt;
return {
messages: [
{ role: 'system', content: [{ text: SYSTEM_PROMPT }] },
{ role: 'user', content: [{ text: promptText }] },
],
//config: { model:'', temperature: 0.3 },
history: input.argHistory,
tools: Object.values(input.argTools),
returnToolRequests: input.argReturnToolRequests,
model: gpt4o, // << MODEL DEFINITION SUPPORTED
};
}
);- Try to use the prompt defined in 1
const renderedPrompt = await renderPrompt({
prompt: definePromptDefinedAbove,
input: {
response: "hello",
retryCount: 0,
argTools: Object.values(this._tools),
argHistory: history,
argReturnToolRequests: true
} ,
model: 'googleai/gemini-pro' SHOULD NOT BE REQUIRED // << model is required
});As you can see the model is required. This negates the point of defining it in the definePrompt
- Furthermore defineDotPrompt does not supprot
tools, history, context so it cannot be used for advanced prompting which makes it limited
Expected behavior
Model should not be required in renderPrompt