instructor icon indicating copy to clipboard operation
instructor copied to clipboard

feat(client,function_calls,process_response,test_new_client): enhance create method to handle multiple responses

Open jxnl opened this issue 10 months ago • 3 comments

Ellipsis :rocket: This PR description was created by Ellipsis for commit bfa4ca14fff73c2d2c28485230933bcdc83fa595.

Summary:

This PR enhances the create method to handle multiple responses from the OpenAI API, updates various methods in function_calls.py and process_response.py to handle multiple responses, and includes a test for multiple responses in test_new_client.py.

Key points:

  • Overloaded create method in client.py to handle multiple responses.
  • Updated handle_kwargs method in client.py to include n parameter in kwargs.
  • Updated function_calls.py to handle multiple responses in parse_functions, parse_tools, and parse_json methods.
  • Updated process_response.py to attach raw response to each model in case of IterableBase response model.
  • Updated test_new_client.py to include a test for multiple responses.

Generated with :heart: by ellipsis.dev

jxnl avatar Apr 08 '24 03:04 jxnl

Deploying instructor with  Cloudflare Pages  Cloudflare Pages

Latest commit: 712f15a
Status: ✅  Deploy successful!
Preview URL: https://53be96dd.instructor.pages.dev
Branch Preview URL: https://support-n.instructor.pages.dev

View logs

@ellipsis-dev can you fix the merge conflicts

jxnl avatar May 08 '24 20:05 jxnl

Could you please specify which files have conflicts and what the conflicts are? This will help me resolve the merge conflicts more effectively. Thank you.


Responding to this comment by @jxnl. For more information about Ellipsis, check the documentation.

ellipsis-dev[bot] avatar May 08 '24 20:05 ellipsis-dev[bot]

Why was this closed without merge? Interested in this feature

josepablog avatar Jun 03 '24 15:06 josepablog

too many conflicts, didnt know if people really needed this

jxnl avatar Jun 07 '24 18:06 jxnl

@jxnl Multiple responses would be incredibly useful to have. I'm trying to do something like Getting 50% (SoTA) on ARC-AGI with GPT-4o, and it requires drawing thousands of independent samples.

thomasahle avatar Jul 19 '24 20:07 thomasahle

we also have this kind of use cases where we want to generate multiple individual samples in one call. it would be great if you can reopen and merge this PR!

xinyiliu128 avatar Aug 06 '24 19:08 xinyiliu128