Jakob-98 / openai-functools

openai-functools: Simplified Generation of OpenAI Functions JSON Metadata for OpenAI Function Calling
https://pypi.org/project/openai-functools/
MIT License
69 stars 9 forks source link

Example with langchain #42

Open MDUYN opened 11 months ago

MDUYN commented 11 months ago

Details

It would be nice to have an example that show how you can integrate the library with langchain

Checklist - [X] Create `examples/langchain_example.py` ✓ https://github.com/Jakob-98/openai-functools/commit/c4597b821277b891b0cf495a4e05319d0d24d813 - [X] Check `examples/langchain_example.py` ✓ https://github.com/Jakob-98/openai-functools/commit/d551151281ebfd46165f1ea0cb94601a545417db - [X] Modify `examples/README.md` ✓ https://github.com/Jakob-98/openai-functools/commit/910339a8fbc35f114d57779fccd290bd9c1608e4 - [X] Check `examples/README.md` ✓ https://github.com/Jakob-98/openai-functools/commit/764d05501d68091bd4a2f5217ca970826831a54f - [X] Modify `README.md` ✓ https://github.com/Jakob-98/openai-functools/commit/adff5f31100b170c59fef733f7c13ead66b85a8e - [X] Check `README.md` ✓ https://github.com/Jakob-98/openai-functools/commit/bbdff5508137a1bc923e01d27f7f9f3805b95b96 ![Flowchart](http://24.199.78.105:8082/public/05d82c1490a2048387ce599ff0c205719d4bdc537a2f1dbdca4cc6e0201e15fd_42_flowchart.svg)
sweep-ai[bot] commented 11 months ago

Here's the PR! https://github.com/Jakob-98/openai-functools/pull/46.

Sweep Basic Tier: I'm using GPT-4. You have 4 GPT-4 tickets left for the month and 3 for the day. (tracking ID: a950f377d2)

For more GPT-4 tickets, visit our payment portal. For a one week free trial, try Sweep Pro (unlimited GPT-4 tickets).

Actions (click)

Sandbox Execution ✓

Here are the sandbox execution logs prior to making any changes:

Sandbox logs for 2352271
trunk fmt README.md || exit 0 1/4 ✓
 ✔ Formatted README.md
Re-checking autofixed files...

Checked 1 file
✔ No issues
trunk check --fix --print-failures README.md 2/4 ✓
Checked 1 file
✔ No issues
Run trunk upgrade to upgrade 2 linters
trunk fmt README.md || exit 0 3/4 ✓
Checked 1 file
✔ No issues
trunk check --fix --print-failures README.md 4/4 ✓
Checked 1 file
✔ No issues

Sandbox passed on the latest main, so sandbox checks will be enabled for this issue.


Step 1: 🔎 Searching

I found the following snippets in your repository. I will now analyze these snippets and come up with a plan.

Some code snippets I looked at (click to expand). If some file is missing from here, you can mention the path in the ticket description. https://github.com/Jakob-98/openai-functools/blob/2352271f52e031a482cc356d410ca4428e1a910f/examples/README.md#L1-L7 https://github.com/Jakob-98/openai-functools/blob/2352271f52e031a482cc356d410ca4428e1a910f/CONTRIBUTING.md#L1-L27 https://github.com/Jakob-98/openai-functools/blob/2352271f52e031a482cc356d410ca4428e1a910f/README.md#L110-L216 https://github.com/Jakob-98/openai-functools/blob/2352271f52e031a482cc356d410ca4428e1a910f/README.md#L1-L70 https://github.com/Jakob-98/openai-functools/blob/2352271f52e031a482cc356d410ca4428e1a910f/poetry.lock#L125-L235

Step 2: ⌨️ Coding

trunk fmt examples/langchain_example.py || exit 0 1/2 ✓
 ✔ Formatted examples/langchain_example.py
Re-checking autofixed files...

 ✔ Formatted examples/langchain_example.py
Re-checking autofixed files...

Checked 1 file
✔ No issues
Run trunk upgrade to upgrade 2 linters
trunk check --fix --print-failures examples/langchain_example.py 2/2 ✓
 ✔ Auto-fixed examples/langchain_example.py
Re-checking autofixed files...

Checked 1 file
✔ No issues

trunk fmt examples/README.md || exit 0 1/2 ✓
 ✔ Formatted examples/README.md
Re-checking autofixed files...

Checked 1 file
✔ No issues
Run trunk upgrade to upgrade 2 linters
trunk check --fix --print-failures examples/README.md 2/2 ✓
Checked 1 file
✔ No issues

trunk fmt README.md || exit 0 1/2 ✓
 ✔ Formatted README.md
Re-checking autofixed files...

Checked 1 file
✔ No issues
Run trunk upgrade to upgrade 2 linters
trunk check --fix --print-failures README.md 2/2 ✓
Checked 1 file
✔ No issues


Step 3: 🔁 Code Review

I have finished reviewing the code for completeness. I did not find errors for sweep/add-langchain-example.


🎉 Latest improvements to Sweep:


💡 To recreate the pull request edit the issue title or description. To tweak the pull request, leave a comment on the pull request. Join Our Discord