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

Fix Starter Code in README #538

Closed

Conversation

aaravnavani
Copy link
Contributor

In this PR, I made 2 changes:

  1. Remove {gr.xml_prefix_prompt} and ${gr.json_suffix_prompt_v2_wo_none} from the prompt section of the sample RAIL Spec.

  2. Change openai.Completion.create to openai.completions.create based on the recent change in the OpenAI API.

@zsimjee
Copy link
Collaborator

zsimjee commented Jan 15, 2024

Thanks for the fix! Did removing the prompt suffixes help get results more consistently? Is that why they were removed?

@codecov-commenter
Copy link

codecov-commenter commented Jan 15, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

❗ No coverage uploaded for pull request base (main@8833c05). Click here to learn what that means.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #538   +/-   ##
=======================================
  Coverage        ?   82.78%           
=======================================
  Files           ?       93           
  Lines           ?     5751           
  Branches        ?        0           
=======================================
  Hits            ?     4761           
  Misses          ?      990           
  Partials        ?        0           
Flag Coverage Δ
unittests 82.78% <0.00%> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@aaravnavani
Copy link
Contributor Author

@zsimjee When I included the prompt suffixes, I got this response from the LLM:

validated_output {'bank_run': {'explanation': 'stringgggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggg', 'follow_up_url': 'https://example.com'}}

When I removed the prompt suffixes, the response is as expected:

validated_output {'bank_run': {'explanation': "A bank run is when a large number of customers withdraw their money from a bank at the same time, usually due to fears of the bank's financial stability. This can lead to a bank's collapse and cause a ripple effect on the economy.", 'follow_up_url': 'https://www.investopedia.com/terms/b/bankrun.asp'}}

I'm not really sure why that happens, as the {gr.xml_prefix_prompt} and the {gr.json_suffix_prompt_v2_wo_none} are properly set in constants.xml.

@zsimjee
Copy link
Collaborator

zsimjee commented Jan 16, 2024

That’s hilarious!! Davinci 003 used to be our default model and it worked really well with instruction following. I think this might be a model-to-model issue. Sounds good though!

@zsimjee
Copy link
Collaborator

zsimjee commented Jan 16, 2024

We'll merge this one, and I have this as a follow up - #540. I think we could do better than this example, we just need to find a better usage that shows how guardrails is useful.

@zsimjee
Copy link
Collaborator

zsimjee commented Jan 22, 2024

Closing this in favor of #549

@zsimjee zsimjee closed this Jan 22, 2024
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.

3 participants