use Bing search
This commit is contained in:
35
openAI_validate_data/2025-07_gpt01_dialogue/request.py
Normal file
35
openAI_validate_data/2025-07_gpt01_dialogue/request.py
Normal file
@@ -0,0 +1,35 @@
|
||||
from openai import OpenAI
|
||||
from copy import deepcopy
|
||||
client = OpenAI()
|
||||
|
||||
startQuestion = """Ich hab hier unvalidierte Daten zu psychologischen Einrichtungen oder Angeboten, die ich gerne validiert und ggf. korrigiert hätte.
|
||||
Checke bitte, ob die Angebote die korrekte Adresse und Webseite haben. Ggf kannst du ja noch passende Themen in Kürze auflisten.
|
||||
Sag mir, was du an den Daten ändern würdest. Halte dich kurz.
|
||||
|
||||
Name,Firma,Straße,StraßeNrEingabe,StraßeEingabe,PLZ,Ort,Bundesland,DRV Gebiet,Landkreis,Telefon,Themen,Telefon mobil,Email,HomePage,Themen
|
||||
Regionaldienste des Jugendamtes Lichtenberg,Bezirksamt Lichtenberg,Große Leege-Straße 103,103,Große Leege-Straße,13055,Berlin,Berlin,Berlin-Brandenburg,,030 90296-7031,,030 90296-7031,juginfo@lichtenberg.berlin.de,,http://www.berlin.de,
|
||||
"""
|
||||
choice = "start"
|
||||
|
||||
while (choice != ""):
|
||||
choice2 = input("Press 'Enter' to call ChatGPT now.. ")
|
||||
if (choice2 == ""):
|
||||
completion = client.chat.completions.create(
|
||||
model="gpt-4o-mini",
|
||||
messages=[
|
||||
{"role": "system", "content": "You are a helpful assistant."},
|
||||
{
|
||||
"role": "user",
|
||||
"content": startQuestion if choice == "start" else choice
|
||||
}
|
||||
]
|
||||
)
|
||||
|
||||
response = completion.choices[0].message
|
||||
|
||||
print("Response: \n'"+ response.content + "'")
|
||||
del response.content
|
||||
|
||||
print("\nEnveloped response content: ", response)
|
||||
choice = input("Ask something or leave blank to exit.. ").strip()
|
||||
print("Ok ciao")
|
Reference in New Issue
Block a user