GH-KN
(GH-KN)
January 22, 2023, 1:13pm
1
Hi,
On linkedin I saw a post on somebody who used chat GPT in grasshopper as a component.
Does anyone have a script or a step by step approach how to realize this?
Just to be clear I would like to ‘ask’ a question in a GH panel, plug it in the ‘chatgpt’ component’, with output an textual answer?
Many thanks
1 Like
Try the forum search feature: Search results for 'chatGPT' - McNeel Forum
We’ve trained a model called ChatGPT which interacts in a conversational way. The dialogue format makes it possible for ChatGPT to answer followup questions, admit its mistakes, challenge incorrect premises, and reject inappropriate requests. ChatGPT...
Japhy
(Japhy)
January 22, 2023, 2:07pm
3
There are a few out there, most are custom GH components made with python/C# like this one.
openAI_ChatGPT3.py
import urllib2
import json
# Set the endpoint URL and the prompt text
url = "https://api.openai.com/v1/completions"
# Set the API key and other parameters
data = json.dumps({ "model": "text-davinci-003", "prompt": prompt, "temperature": 0.5, "max_tokens": 1024})
headers = { "Content-Type": "application/json", "Authorization": "Bearer {0}".format(api_key) }
This file has been truncated. show original
Ambrosinus Toolkit is coming along
https://raw.githubusercontent.com/lucianoambrosini/Ambrosinus-Toolkit/main/latest_version.txt
4 Likes
I create this based on the python code posted by @Japhy
Try it, you need an api key
of course.
ChatGPT.gh (71.8 KB)
2 Likes
Hello, sorry i want to ask how to get an API key
Japhy
(Japhy)
February 18, 2023, 1:25pm
7
Here’s step by step instructions.
2 Likes
Romans
March 13, 2023, 11:30am
8
Hello, I have tried you code. Do you know which libraries/dependencies should I install? Can I paste API key into a Panel as API key input? Also when I input question in Run Button, grasshopper crashes…
Hi , test this
Shared with Dropbox
If this don’t work for you, i think there are other tools available in the forum
4 Likes
Romans
March 13, 2023, 12:03pm
10
Hello, thank you for the tool. But my grasshopper crashes anyway after pressing enter…
I don’t know why, search in the forum to find other tools
Rh-3d-p
(R-d)
April 8, 2023, 1:45pm
13
Hi @seghierkhaled and @Japhy @Dani_Abalde
Awesome !
this site also Open.Ai. And it have openSource Code
(Sketch + Description To >》Picture)
For example my 2d rhino image convert to 3d ?
Can you add python code in grasshopper too?,
Convert(Sketch + Description To >》Picture)
1 Like
Thanks
This work with Python 3+, Maybe it will work in Rhino 8
fn_a
(fn_a)
May 7, 2023, 8:05pm
15
Hi @anon39580149 ,
What kind of component works for api key?
Thank you
Did you test the file posted above?
fn_a
(fn_a)
May 7, 2023, 8:54pm
17
Hi @anon39580149 ,
I tested the chatgpt component with my api key from Open.ai, but it seem to do nothing (the interface opens, you can enter text, but there isn’t response)
For insert api key string I used a simple panel component
Thank you
Everything works fine here
There are other components available in the forum, test them with your api key
fn_a
(fn_a)
May 8, 2023, 10:44am
19
Thank you @anon39580149 ,
but what kind of component do you use to insert api key?
Make sure you choose a folder when you use Image component and check your account maybe your api expired
1 Like
Use these websites It’s better than ChatGPT, because it offers unlimited prompts.
2 Likes