Skip to content

[Tooling] definePrompt defineDotPrompt design fault  #330

@AshleyTuring

Description

@AshleyTuring

Describe the bug

  1. renderPrompt requires model which negates the point of defining it within definePrompt
  2. 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
    };
  }
);
  1. 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

  1. 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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingtooling

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions