Welcome to the Sambanova API Wrapper! 🎉 This Python script provides a simple way to interact with the Sambanova AI API for Free.
Before you begin, make sure you have the following:
- Python installed on your machine. 🐍
- Required Packages: Install the necessary Python packages using pip:
pip install requests fake-useragent
- Install the Cookie-Editor extension for either Chrome or Edge:
Once you have the Cookie-Editor installed, follow these steps to export your cookies:
- Open the website from which you want to extract cookies. 🌐
- Click on the Cookie-Editor extension icon. 🔍
- Click the "Export" button to save your cookies in JSON format. 💾
- Create a file in your working directory named
cookies.json
. 🗂️ - Paste the data copied from the Cookie-Editor into
cookies.json
and save it. ✨
Please note that usage limits for the Sambanova API are not publicly documented. Be mindful of your usage to avoid potential restrictions. 🚦
Let's explore some examples of how to use the Sambanova API Wrapper! 🎈
api = SambanovaAPI('cookie.json', model='Meta-Llama-3.2-1B-Instruct', system_prompt="You are a helpful assistant.")
for response in api.ask("What is the capital of France?"):
print(response, end="", flush=True)
api = SambanovaAPI('cookie.json', model='Meta-Llama-3.1-70B-Instruct', system_prompt="You are a knowledgeable expert on 19th-century literature.")
for response in api.ask("Discuss the themes of realism in the novels of Gustave Flaubert."):
print(response, end="", flush=True)
Contributions are welcome! If you have suggestions or improvements, feel free to open an issue or submit a pull request.
This project is licensed under the MIT License
Thank you for using the Sambanova API Wrapper! We hope you find it helpful and enjoyable! Happy coding! 🎊💖