#replying with completely irrelevant text.
51 messages · Page 1 of 1 (latest)
Can you send the code for the completion request? Print out what the prompt is beforehand for one of these messages in the chat as well and show me, also, what are the model settings set to?
is this the completion request code?
@client.event
async def on_message(message):
try:
# Ignore messages from the bot itself or messages without the prefix
if message.author == client.user:
return
else:
prompt = message.content
response = openai.Completion.create(
engine="davinci",
prompt=prompt,
max_tokens=50
)
print(prompt)
# Send GPT response back to the user
await message.channel.send(response.choices[0].text)
print(f"Sent response: {response.choices[0].text}")
except Exception as e:
print(f"Error: {e}")
I dont quite know how to get it to print the prompt out, i've tried in all the ways that I know but it wont work, and I cant ask chatgpt like I usually would because its at capacity :(
I also dont know what you mean by the model settings 🥲
i'm sorry, I really dont know what i'm doing
but any help you can give i'll take and highly appreciate
btw, if you dont want to take all the time to explain difficult coding stuff to a noob like me I totally get it, there are people with more important and easier to solve issues out there
So the "engine" parameter doesn't exist anymore
That completion request takes in a model parameter
here's some documentation
actually sorry, there is an engine parameter but it's buggy
try replacing engine="davinci" with model="text-davinci-003"
where is the prompt first initially defined here?
prompt = message.content right? its taking the discord message and putting it in the prompt variable, which then gets used as the prompt for gpt
thats my understanding of it anyway
also I swapped 'engine=davinci' with model="text-davinci-003" but it seemed to have no effect
Oops yes i'm blind i missed that part in the code you sent
all good :)
Can you try increasing the max tokens? also, add two new params "temperature" and "top_p" and set both to 1
is 100 good?
Try 1024
same thing but a lot longer lol, I said 'test' and got some company's privacy policy, and I said 'hello, how are you' and got some javascript
have I done it right?
@client.event
async def on_message(message):
try:
if message.author == client.user:
return
else:
prompt = message.content
print(prompt)
response = openai.Completion.create(
model="text-davinci-003",
prompt=prompt,
max_tokens=1024,
temperature=1,
top_p=1
)
await message.channel.send(response.choices[0].text)
print(f"Sent response: {response.choices[0].text}")
except Exception as e:
print(f"Error: {e}")
pycharm says there's no errors or warnings but maybe its something else
do you think its a me thing or not a me thing
Is there anyone around who can help?
Well, @tacit dust , check out https://replit.com/@Darkness-Bright/darkness
It contains the source code files for a discord bot using the openai api and using flask to serve responses.
result:
all I can see is 'index'
the code is a bit messy,
but it serves me well.
the "index" there is just a placeholder for the html page hosted at https://darkness.darkness-birght.repl.co
maybe i'll improve that when i have time
yea i'm not well versed enough in coding to know how this works, I really appreciate your help though :)
What happens if you set the temperature to 0?
more javascript :(
just realised no matter what i set the settings to its not only spitting out one bit of javascript
package com.example.demo.controller;
import com.example.demo.model.User;
import com.example.demo.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.util.List;
@RestController
@RequestMapping("/user")
public class UserController {
@Autowired
private UserService userService;
@GetMapping("/all")
public List<User> getAllUsers(){
return userService.getAllUsers();
}
@PostMapping("/add")
public void addUser(@RequestBody User user){
userService.addUser(user);
}
@PutMapping("/update")
public void updateUser(@RequestBody User user){
userService.updateUser(user);
}
@DeleteMapping("/delete/{id}")
public void deleteUser(@PathVariable int id){
userService.deleteUser(id);
}
}
idk if it has anything to do with anything but eh
If you need some help on just the for python, use https://replit.com/@markzhere/OpenAI-Assistant
as a reference.
A minimalist assistant that answers any question.
It can access the internet and use developed AI to get answers.
Now there is a new repl: https://replit.com/@markzhere/ChatGPT-OPEN
It uses GPT3 and needs an api key to operate. Get one at https://beta.openai.com/account/api-keys
Powered by OpenAI. Credits to @ZacharyWitten for the origina...