Comments (11)
Typo correction on the above: here’s the script (the error appears on: ‘
from openai import OpenAI‘)
import openai
from openai import OpenAI
client = OpenAI(api_key="YOUR_KEY_HERE")
def chat():
prompt = input('Please write your prompt here\n')
completion = client.chat.completions.create(
model="gpt-4",
messages=[
{"role": "user", "content": prompt}
]
)
return(print(completion.choices[0].message.content))
def main():
chat()
if name == "main":
main()
from pythonista-issues.
I get an error
What is the error???? When asking questions about software that involve error messages, please always include the full error messages, always. Otherwise people won't be able to help because it's unclear what exactly is wrong with the code. Another important thing is to format you code properly. Reading the messy code you posted is infuriating. People are going to get mad and skip your question instead of answering.
from pythonista-issues.
from pythonista-issues.
from pythonista-issues.
from pythonista-issues.
from pythonista-issues.
openai is not a Pythonista built-in module
Well that's confusing.
from pythonista-issues.
Try this:
import openai
openai.api_key = "YOUR_API_KEY_HERE"
def chat():
prompt = input("Please write your prompt here\n")
completion = openai.ChatCompletion.create(
model="gpt-4", messages=[{"role": "user", "content": prompt}]
)
return print(completion.choices[0].message.content)
def main():
chat()
if __name__ == "__main__":
main()
from pythonista-issues.
Thanks! It seems to work technically but here’s my first question:
are you GPT4?
No, I am not GPT4. I am an AI model created by OpenAI known as GPT-3. As of this conversation, a GPT-4 model does not exist.
Then I tried this (wanted to see if I’ll at least get Bard if not Gemini as an answer:
what is the name of Googe's Large Language Model that competes with OpenAI’s one?
Google's Large Language Model that competes with OpenAI’s model is called LaMDA.
So what do you think? I think I’m still on GPT-3 . Any further ideas?
from pythonista-issues.
I just looked into it a bit and apparently it is normal for it to say that because of the data it has been trained on. The web GPT-4 doesn't say it, but the API does.
To answer your second question about not recognising Bard or Gemini, it will not recognise them because the dataset used is cut off at 2021 according to the link below.
You can read more about it here:
https://community.openai.com/t/gpt-4-through-api-says-its-gpt-3/286881
from pythonista-issues.
Excellent. Thank you!
from pythonista-issues.
Related Issues (20)
- Displaying modal Scene from Scene that has no children gives `max() arg is an empty sequence` error HOT 2
- Console dialogs does not appear and freeze script HOT 7
- Feature: Widget Interaction
- Please add a GitHub Discussion HOT 1
- Making apps
- See Hidden Files HOT 2
- Pythonista hangs on opening Photo Library HOT 9
- Keyboard - Haptic Feedback
- Using sound.recorder causes volume of speech.say to become very low HOT 2
- py_ssize_t_clean macro must be defined for '#' formats | Module CB HOT 1
- Folders with subfolders and submodules named the same cause import problem
- Adding folder in SD card to EXTERNAL FILES section will fail and show error
- contacts.phone not filled
- will_close() and wait_modal() not working on presented view
- Ui.get_screen_size() gets wrong resolution HOT 1
- Pythonista - graphic performance HOT 1
- Apple Family Sharing
- Pandas import HOT 1
- paythin
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pythonista-issues.