This commit is contained in:
nsde 2023-08-08 01:04:08 +02:00
commit 02f7780761
2 changed files with 15 additions and 15 deletions

View file

@ -16,7 +16,7 @@ async def get_credentials(interaction):
try:
get_response = await accounts.request_user_by_discord_id(interaction.user.id)
except Exception as exc:
await embedder.error(interaction, """Sorry,
await embedder.error(interaction, """Sorry,\n" \
there was an issue while checking if you already have an account.
Please report this issue to the staff!""", ephemeral=True)
raise exc

View file

@ -62,20 +62,20 @@ Don't have `pip` installed? Learn more here: https://pip.pypa.io/en/stable/insta
if how_can_i == 'use the Python library':
text = """For the official `openai` Python library, you just need to set the `openai.api_base` to `https://api.nova-oss.com/v1`.
```py
import openai
from nova_python import Models, Endpoints, NovaClient
openai.api_key = "PUT_YOUR_NOVA_AI_API_KEY_IN_HERE"
openai.api_base = "https://api.nova-oss.com/v1"
client = NovaClient('YOUR_API_KEY')
completion = openai.ChatCompletion.create(
model="gpt-3.5-turbo",
messages=[
reponse = client.make_request(
endpoint = Endpoints.CHAT_COMPLETION,
model = Models.GPT3,
data=[
{"role": "system", "content": "You are a helpful assistant."},
{"role": "user", "content": "Hello!"}
{"role": "user", "content": "What is the highest mountain?"}
]
)
print(completion.choices[0].message)
print(reponse.get_message_content())
```
"""