easy to use openai apis
Project description
NextJS Project
- Add openai-wrapper.ts in lib folder in NextJS Project
-
Examples
Example usage
if name == "main": # Initialize the wrapper wrapper = SimpleOpenAIWrapper( service_provider="openai", max_retries=3 )
# Generate a response
system_prompt = "You are a helpful assistant."
user_prompt = "Explain the significance of the Pythagorean theorem."
response = wrapper.generate_response(
system_prompt=system_prompt,
user_prompt=user_prompt,
model="gpt-4",
max_tokens=150,
output_format="str"
)
print("Response:", response)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file opengig_openai_wrapper-0.1.1.tar.gz.
File metadata
- Download URL: opengig_openai_wrapper-0.1.1.tar.gz
- Upload date:
- Size: 2.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.4 CPython/3.13.1 Darwin/23.3.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b6e4aca5ccac7330663e5e55550362612eb8dc5a13fc9cf033eb78eb3dace6b9
|
|
| MD5 |
9b078d51fb6837c718c34d726b1dfa0e
|
|
| BLAKE2b-256 |
e2877518b80ecb75ed04892d7df8e6116d863f9fbe7fb7ee5f799b2995d910a2
|
File details
Details for the file opengig_openai_wrapper-0.1.1-py3-none-any.whl.
File metadata
- Download URL: opengig_openai_wrapper-0.1.1-py3-none-any.whl
- Upload date:
- Size: 3.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.4 CPython/3.13.1 Darwin/23.3.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7663f49818af721dfe839264c26b2c4b203d40633a8a244a2f39685e9cd4e253
|
|
| MD5 |
7ffa0960ea9ef60e7f6d1dcc8324b618
|
|
| BLAKE2b-256 |
f603c89711526d33b1dd18a66556cb0ff9d71d19981296329471a6b525632f28
|