Update app.py
Browse files
app.py
CHANGED
|
@@ -27,16 +27,18 @@ print("=========\nBegin definition Backend Logic\n")
|
|
| 27 |
print("Create default API settings")
|
| 28 |
client = genai.Client(
|
| 29 |
api_key=os.getenv("GEMINI_API_KEY"),
|
| 30 |
-
http_options=types.HttpOptions(api_version='v1alpha'),
|
| 31 |
)
|
|
|
|
| 32 |
used_model = "gemini-2.5-flash-preview-04-17"
|
| 33 |
|
|
|
|
| 34 |
def model_response(message, history):
|
| 35 |
chat = client.chats.create(model=used_model, history=history)
|
| 36 |
response = chat.send_message(message)
|
| 37 |
return response
|
| 38 |
|
| 39 |
-
print("
|
| 40 |
def random_response(message, history):
|
| 41 |
return random.choice(["Yes", "No"])
|
| 42 |
|
|
|
|
| 27 |
print("Create default API settings")
|
| 28 |
client = genai.Client(
|
| 29 |
api_key=os.getenv("GEMINI_API_KEY"),
|
| 30 |
+
http_options=genai.types.HttpOptions(api_version='v1alpha'),
|
| 31 |
)
|
| 32 |
+
print("Set default model")
|
| 33 |
used_model = "gemini-2.5-flash-preview-04-17"
|
| 34 |
|
| 35 |
+
print("Define test response work")
|
| 36 |
def model_response(message, history):
|
| 37 |
chat = client.chats.create(model=used_model, history=history)
|
| 38 |
response = chat.send_message(message)
|
| 39 |
return response
|
| 40 |
|
| 41 |
+
print("Define test1 response work")
|
| 42 |
def random_response(message, history):
|
| 43 |
return random.choice(["Yes", "No"])
|
| 44 |
|