Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add support for calling specific functions for python prompt #533

Merged
merged 1 commit into from
Mar 7, 2024

Conversation

typpo
Copy link
Collaborator

@typpo typpo commented Mar 7, 2024

Related to #507

Example:

promptfooconfig.yaml:

prompts:
  - prompt_python.py:prompt1
  - prompt_python.py:prompt2
providers: 
  - openai:gpt-3.5-turbo-0613
tests:
  - vars:
      topic: bananas

prompt_python.py:

def prompt1(context):
    return f'Write a one-sentence compliment for anyone who likes {context["vars"]["topic"]}.'

def prompt2(context):
    return f'Describe {context["vars"]["topic"]} concisely, comparing it to the Python programming language.'

@typpo typpo merged commit ccd81b3 into main Mar 7, 2024
18 checks passed
@typpo typpo deleted the py-multi-prompts branch March 7, 2024 17:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant