https://github.com/aniketdash7/keyword_args_to_llm
https://github.com/aniketdash7/keyword_args_to_llm
Last synced: 2 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/aniketdash7/keyword_args_to_llm
- Owner: aniketDash7
- Created: 2024-02-28T06:11:39.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-02-28T18:23:03.000Z (over 1 year ago)
- Last Synced: 2025-01-28T23:09:16.788Z (4 months ago)
- Size: 2.93 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Code Intepreter
We can pass in keyword arguments to 'ChatCompletion' of 'openai', functions being one of them. Let's say we have a very simple function that adds two integers.
We want to pass this function 'ChatCompletion.create'. One important thing to keep in mind is that, we can not pass the python function directly. We have to pass
in the JSON schema.
It is a bit different from how we program computers. The key thing to program computers is the docstring, in this case. The GPT will look at the docstring and knows about the function and what it does. So it is critical to keep the docstring in mind which should exactly describe what the function does.Like we used to pass in custom instructions programmatically using system messages, we can pass in functions using the "role" as "function"