mirror of
https://github.com/NovaOSS/nova-cord.git
synced 2024-11-25 23:43:57 +01:00
Compare commits
No commits in common. "d3aa6ea80343a25c4edf33699f612ffe3f28b4b4" and "151c9cda779d01f2c95324db09cf3e57d7403492" have entirely different histories.
d3aa6ea803
...
151c9cda77
|
@ -40,7 +40,7 @@ async def chat(interaction: nextcord.Interaction,
|
||||||
):
|
):
|
||||||
await chatbot.respond(interaction, prompt)
|
await chatbot.respond(interaction, prompt)
|
||||||
|
|
||||||
@bot.slash_command(description='Sets your DMs up, so you can message to the bot.')
|
@bot.slash_command(description='Sets your DMs up, so you can write the bot.')
|
||||||
async def dm_setup(interaction: nextcord.Interaction):
|
async def dm_setup(interaction: nextcord.Interaction):
|
||||||
try:
|
try:
|
||||||
await interaction.user.create_dm()
|
await interaction.user.create_dm()
|
||||||
|
|
|
@ -23,7 +23,7 @@ async def send(
|
||||||
color=color
|
color=color
|
||||||
)
|
)
|
||||||
|
|
||||||
embed.set_footer(text='Powered by Nova with ❤️', icon_url='https://i.ibb.co/LDyFcSh/fav-blurple.png')
|
embed.set_footer(text='Powered by NovaAI with ❤️', icon_url='https://i.ibb.co/LDyFcSh/fav-blurple.png')
|
||||||
embed.set_author(name='NovaCord', url='https://nova-oss.com/novacord')
|
embed.set_author(name='NovaCord', url='https://nova-oss.com/novacord')
|
||||||
|
|
||||||
interaction_type = Union[nextcord.Interaction, nextcord.InteractionResponse]
|
interaction_type = Union[nextcord.Interaction, nextcord.InteractionResponse]
|
||||||
|
|
|
@ -62,29 +62,22 @@ Don't have `pip` installed? Learn more here: https://pip.pypa.io/en/stable/insta
|
||||||
"""
|
"""
|
||||||
|
|
||||||
if how_can_i == 'use the Python library':
|
if how_can_i == 'use the Python library':
|
||||||
text = """To use the official `openai` Python library, you just need to do the following.
|
text = """To use the official `nova_python` Python library, you just need to do the following.
|
||||||
```py
|
```py
|
||||||
# Import the OpenAI library (assuming it's already installed)
|
from nova_python import Models, Endpoints, NovaClient
|
||||||
import openai
|
|
||||||
|
|
||||||
# Set the OpenAI API key
|
client = NovaClient('YOUR_API_KEY')
|
||||||
openai.api_key = "NOVA_AI_KEY"
|
|
||||||
|
|
||||||
# Set the OpenAI API base URL
|
reponse = client.make_request(
|
||||||
openai.api_base = "https://api.nova-oss.com/v1/"
|
endpoint = Endpoints.CHAT_COMPLETION,
|
||||||
|
model = Models.GPT3,
|
||||||
# Create a chat completion using the gpt-3.5-turbo model and the user and system messages
|
data=[
|
||||||
completion = openai.ChatCompletion.create(
|
|
||||||
model="gpt-3.5-turbo",
|
|
||||||
messages=[
|
|
||||||
{"role": "system", "content": "You are a helpful assistant."},
|
{"role": "system", "content": "You are a helpful assistant."},
|
||||||
{"role": "user", "content": "What is the highest mountain?"}
|
{"role": "user", "content": "What is the highest mountain?"}
|
||||||
]
|
]
|
||||||
)
|
)
|
||||||
|
|
||||||
# Extract and print the content of the model's response
|
print(reponse.get_message_content())
|
||||||
response_content = completion.choices[0].message.content
|
|
||||||
print(response_content)
|
|
||||||
```
|
```
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue