Skip to content

Commit

Permalink
fix: input for prompt just the entire prompt string (#77)
Browse files Browse the repository at this point in the history
  • Loading branch information
viveknair committed Apr 28, 2023
1 parent 3bbb27f commit 6c5fceb
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions package/gentrace/providers/llms/openai.py
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,9 @@ def wrapper(cls, *args, **kwargs):

if prompt_template and prompt_inputs:
rendered_prompt = pystache.render(prompt_template, prompt_inputs)
else:
# If no prompt template or inputs, then specify the prompt as the entire input
prompt_inputs = prompt

new_completion_options = {
**base_completion_options,
Expand Down Expand Up @@ -196,6 +199,9 @@ def profiled_completion():

if prompt_template and prompt_inputs:
rendered_prompt = pystache.render(prompt_template, prompt_inputs)
else:
# If no prompt template or inputs, then specify the prompt as the entire input
prompt_inputs = prompt

new_completion_options = {
**base_completion_options,
Expand Down Expand Up @@ -245,6 +251,9 @@ async def wrapper(cls, *args, **kwargs):

if prompt_template and prompt_inputs:
rendered_prompt = pystache.render(prompt_template, prompt_inputs)
else:
# If no prompt template or inputs, then specify the prompt as the entire input
prompt_inputs = prompt

new_completion_options = {
**base_completion_options,
Expand Down Expand Up @@ -290,6 +299,9 @@ async def profiled_completion():

if prompt_template and prompt_inputs:
rendered_prompt = pystache.render(prompt_template, prompt_inputs)
else:
# If no prompt template or inputs, then specify the prompt as the entire input
prompt_inputs = prompt

new_completion_options = {
**base_completion_options,
Expand Down

0 comments on commit 6c5fceb

Please sign in to comment.