https://promptfoo.dev/ logo
Prompt function also provide temp?
# ❓|questions
r
I have a prompt management object in my typescript app that defines prompts and their associated temperature, max tokens, etc. I have a JS prompt function that returns them. Is there also a way to have it return the associated options? I don't want to hard code them into the YAML because they might change in the management object.
It would also be cool to have tests apply to different prompts. In my use case I need to replay chat history with a system prompt that’s built into my code.
i
temperature, max tokens etc is handled by the provider. So unfortunately in this case you'd probably have to use a [custom api provider](https://promptfoo.dev/docs/providers/custom-api)
r
Got it my use case is a little different I guess. I want to import a system prompt from my codebase then send a series of chat messages. The first message having a different test than the subsequent ones. It looks like I can only do this with JSON and the templating langauge right?
i
Sorry I'm probably too late on this reply, but in theory you could do this either with a custom provider, or by using a [dynamic variable](https://promptfoo.dev/docs/configuration/guide/#javascript-variables) (loading the system prompt from your codebase) and then putting the series of chat messages in your test case.