👨‍🏫 Tutorial How To Get ᑕᕼᗩTGᑭT-4 API Access (API Keys)

Boss pano mo napagana pahelp naman po
Nagpagawa lang ako ng chat script sa ᑕᕼᗩTGᑭT

Eto
Download
lagay mo api mo sa YOUR_API_KEY

gamitin mo index.php kung may host ka or kung kaya mo paganahin sa xampp, sakin kasi ayaw sa xampp
basic interface lang yan at hindi din continues conversation, ikaw na mag-upgrade

kung maalam ka naman sa python gamitin mo api.py
edit mo lang Hello, how are you? kung ano gusto mo itanong bago mo i-run yung python
yung sagot nya ipi-print sa output.txt
ikaw nalang din mag-upgrade ng code for your convenience
 
Nagpagawa lang ako ng chat script sa ᑕᕼᗩTGᑭT

Eto
Download
lagay mo api mo sa YOUR_API_KEY

gamitin mo index.php kung may host ka or kung kaya mo paganahin sa xampp, sakin kasi ayaw sa xampp
basic interface lang yan at hindi din continues conversation, ikaw na mag-upgrade

kung maalam ka naman sa python gamitin mo api.py
edit mo lang Hello, how are you? kung ano gusto mo itanong bago mo i-run yung python
yung sagot nya ipi-print sa output.txt
ikaw nalang din mag-upgrade ng code for your convenience
salamat boss, d na kailangan mag design hehe
 
salamat boss, d na kailangan mag design hehe
Kung gusto mo mabilis mag design, gamit ka blackbox.ai/screenshot
Upload ka lang screenshot or kahit mag drawing ka ng design na gusto mo, hindi sya lagi perfect pero makakakuha ka ng idea

Btw, wala din handlers yang index.php kaya kung may html sa input or response, marerender yan sa page 😅
Hindi parin nagana copy button haha, focus lang kasi yan sa pagtry ng api
 
Nagpagawa lang ako ng chat script sa ᑕᕼᗩTGᑭT

Eto
Download
lagay mo api mo sa YOUR_API_KEY

gamitin mo index.php kung may host ka or kung kaya mo paganahin sa xampp, sakin kasi ayaw sa xampp
basic interface lang yan at hindi din continues conversation, ikaw na mag-upgrade

kung maalam ka naman sa python gamitin mo api.py
edit mo lang Hello, how are you? kung ano gusto mo itanong bago mo i-run yung python
yung sagot nya ipi-print sa output.txt
ikaw nalang din mag-upgrade ng code for your convenience
Boss maraming salamat po nahihirapan po ako puro failed to fetch hahahaha newbie lang po
 
ang haba na pala nito ngayon ko lang ulit nabisita.

1730794070364.webp


yung ginawa skaen ng ai para gumawa ng chatbot sa python na may ui. susme AHAHAHHA
 
Ayos ahh, pwede pala yun haha
ou boss ahahaha

eto full code nyan.

import requests
import tkinter as tk
from tkinter import ttk
API_URL = "You do not have permission to view the full content of this post. Log in or register now."
API_KEY = "1c5c56b1-fdbc-45d9-b3b1-9f4b4e645f0a"
def send_message(user_input):
headers = {
"x-api-key": API_KEY,
"Content-Type": "application/json"
}
data = {
"model": "gpt-4",
"messages": [
{"role": "user", "content": user_input}
]
}
response = requests.post(API_URL, headers=headers, json=data)
if response.status_code == 200:
response_data = response.json()
assistant_reply = response_data["choices"][0]["message"]["content"]
return assistant_reply
else:
return "Error: Unable to get response from the API."
def on_send_click():
user_input = user_input_entry.get()
conversation_text.insert(tk.END, "You: " + user_input + "\n")
user_input_entry.delete(0, tk.END)
assistant_reply = send_message(user_input)
conversation_text.insert(tk.END, "Assistant: " + assistant_reply + "\n")
window = tk.Tk()
window.title("Chatbot")
conversation_text = tk.Text(window, height=20, width=50)
conversation_text.pack(pady=10)
user_input_entry = ttk.Entry(window, width=50)
user_input_entry.pack(pady=5)
send_button = ttk.Button(window, text="Send", command=on_send_click)
send_button.pack()
window.mainloop()

d lang ayos indent teka lagay ko sa ctxt

You do not have permission to view the full content of this post. Log in or register now.
 
Boss maraming salamat po nahihirapan po ako puro failed to fetch hahahaha newbie lang po
Ako din naman walang alam jan, papatulong lang di ako sa ai :ROFLMAO:

try mo patulong sa dito
designs.ai
You do not have permission to view the full content of this post. Log in or register now.
recomended ko gamitin mo sa chat yung claude 3.5 sonnet, para sakin mas maayos sagot nya at mas consistent pag dating sa coding kesa gpt4, pero tinatry ko parin sa gpt4 pag di nya makuha gusto ko
 
Ako din naman walang alam jan, papatulong lang di ako sa ai :ROFLMAO:

try mo patulong sa dito
designs.ai
[Hidden content]

recomended ko gamitin mo sa chat yung claude 3.5 sonnet, para sakin mas maayos sagot nya at mas consistent pag dating sa coding kesa gpt4, pero tinatry ko parin sa gpt4 pag di nya makuha gusto ko
mas okay si claude when coding pansin ko lang. yun din gamit ko e. imbis gpt 4. pansin ko lang kapag nag papa decode ako minsan sensitive si claude ayaw i decode si gpt dinedecode kahit konte HAHAA
 
ou boss ahahaha

eto full code nyan.

import requests
import tkinter as tk
from tkinter import ttk
API_URL = "You do not have permission to view the full content of this post. Log in or register now."
API_KEY = "1c5c56b1-fdbc-45d9-b3b1-9f4b4e645f0a"
def send_message(user_input):
headers = {
"x-api-key": API_KEY,
"Content-Type": "application/json"
}
data = {
"model": "gpt-4",
"messages": [
{"role": "user", "content": user_input}
]
}
response = requests.post(API_URL, headers=headers, json=data)
if response.status_code == 200:
response_data = response.json()
assistant_reply = response_data["choices"][0]["message"]["content"]
return assistant_reply
else:
return "Error: Unable to get response from the API."
def on_send_click():
user_input = user_input_entry.get()
conversation_text.insert(tk.END, "You: " + user_input + "\n")
user_input_entry.delete(0, tk.END)
assistant_reply = send_message(user_input)
conversation_text.insert(tk.END, "Assistant: " + assistant_reply + "\n")
window = tk.Tk()
window.title("Chatbot")
conversation_text = tk.Text(window, height=20, width=50)
conversation_text.pack(pady=10)
user_input_entry = ttk.Entry(window, width=50)
user_input_entry.pack(pady=5)
send_button = ttk.Button(window, text="Send", command=on_send_click)
send_button.pack()
window.mainloop()

d lang ayos indent teka lagay ko sa ctxt

You do not have permission to view the full content of this post. Log in or register now.
Thanks.. pero sa web muna ako, tapos na kasi yung chat interface ko 😅
 
ou boss ahahaha

eto full code nyan.

import requests
import tkinter as tk
from tkinter import ttk
API_URL = "You do not have permission to view the full content of this post. Log in or register now."
API_KEY = "1c5c56b1-fdbc-45d9-b3b1-9f4b4e645f0a"
def send_message(user_input):
headers = {
"x-api-key": API_KEY,
"Content-Type": "application/json"
}
data = {
"model": "gpt-4",
"messages": [
{"role": "user", "content": user_input}
]
}
response = requests.post(API_URL, headers=headers, json=data)
if response.status_code == 200:
response_data = response.json()
assistant_reply = response_data["choices"][0]["message"]["content"]
return assistant_reply
else:
return "Error: Unable to get response from the API."
def on_send_click():
user_input = user_input_entry.get()
conversation_text.insert(tk.END, "You: " + user_input + "\n")
user_input_entry.delete(0, tk.END)
assistant_reply = send_message(user_input)
conversation_text.insert(tk.END, "Assistant: " + assistant_reply + "\n")
window = tk.Tk()
window.title("Chatbot")
conversation_text = tk.Text(window, height=20, width=50)
conversation_text.pack(pady=10)
user_input_entry = ttk.Entry(window, width=50)
user_input_entry.pack(pady=5)
send_button = ttk.Button(window, text="Send", command=on_send_click)
send_button.pack()
window.mainloop()

d lang ayos indent teka lagay ko sa ctxt

You do not have permission to view the full content of this post. Log in or register now.
Legal po ba to ?
 
mas okay si claude when coding pansin ko lang. yun din gamit ko e. imbis gpt 4. pansin ko lang kapag nag papa decode ako minsan sensitive si claude ayaw i decode si gpt dinedecode kahit konte HAHAA
Mas ok nga sya.. kahapon ko lang din natry yan claude, nabwisit kasi ako sa gpt4, pag may pinaayos ako may ibang lalabas na error HAHAHA
 

About this Thread

  • 129
    Replies
  • 3K
    Views
  • 96
    Participants
Last reply from:
Mr DarkDonut

Trending Topics

Online now

Members online
1,145
Guests online
1,837
Total visitors
2,982

Forum statistics

Threads
2,288,585
Posts
29,052,619
Members
1,214,192
Latest member
wymsy
Back
Top