Code Monkey home page Code Monkey logo

Comments (11)

rafiyoeliaero avatar rafiyoeliaero commented on July 24, 2024

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.

ForceBru avatar ForceBru commented on July 24, 2024

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.

rafiyoeliaero avatar rafiyoeliaero commented on July 24, 2024

from pythonista-issues.

rafiyoeliaero avatar rafiyoeliaero commented on July 24, 2024

Here’s the screenshot: Pythonista GPT4 error

from pythonista-issues.

rafiyoeliaero avatar rafiyoeliaero commented on July 24, 2024

from pythonista-issues.

rafiyoeliaero avatar rafiyoeliaero commented on July 24, 2024

from pythonista-issues.

TFWol avatar TFWol commented on July 24, 2024

openai is not a Pythonista built-in module

Well that's confusing.

App documentation:
image

Website documentation:
image

from pythonista-issues.

ChelsWin avatar ChelsWin commented on July 24, 2024

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.

rafiyoeliaero avatar rafiyoeliaero commented on July 24, 2024

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.

ChelsWin avatar ChelsWin commented on July 24, 2024

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.

rafiyoeliaero avatar rafiyoeliaero commented on July 24, 2024

Excellent. Thank you!

from pythonista-issues.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.