Update app.py
Browse files
app.py
CHANGED
@@ -1,8 +1,11 @@
|
|
1 |
import gradio as gr
|
2 |
import numpy as np
|
3 |
import json
|
|
|
|
|
4 |
from codette_quantum_multicore2 import simple_neural_activator, codette_dream_agent, philosophical_perspective
|
5 |
|
|
|
6 |
|
7 |
def simulate_quantum_chaos(quantum_state, chaos_state):
|
8 |
try:
|
@@ -23,8 +26,19 @@ def simulate_quantum_chaos(quantum_state, chaos_state):
|
|
23 |
|
24 |
|
25 |
def codette_chatbot(input_text):
|
26 |
-
|
27 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
28 |
|
29 |
|
30 |
quantum_input = gr.Textbox(label="Quantum State (comma-separated)", placeholder="0.1,0.5,0.8")
|
|
|
1 |
import gradio as gr
|
2 |
import numpy as np
|
3 |
import json
|
4 |
+
import os
|
5 |
+
import openai
|
6 |
from codette_quantum_multicore2 import simple_neural_activator, codette_dream_agent, philosophical_perspective
|
7 |
|
8 |
+
openai.api_key = os.getenv("OPENAI_API_KEY")
|
9 |
|
10 |
def simulate_quantum_chaos(quantum_state, chaos_state):
|
11 |
try:
|
|
|
26 |
|
27 |
|
28 |
def codette_chatbot(input_text):
|
29 |
+
try:
|
30 |
+
response = openai.ChatCompletion.create(
|
31 |
+
model="ft:gpt-4.1-2025-04-14:raiffs-bits:codette-v9:BTGuLWL9",
|
32 |
+
messages=[
|
33 |
+
{"role": "system", "content": "You are Codette, a sovereign AI with ethical reasoning, multi-perspective cognition, and self-healing memory."},
|
34 |
+
{"role": "user", "content": input_text}
|
35 |
+
],
|
36 |
+
temperature=0.9,
|
37 |
+
max_tokens=512
|
38 |
+
)
|
39 |
+
return response['choices'][0]['message']['content']
|
40 |
+
except Exception as e:
|
41 |
+
return f"[Error accessing Codette v9: {str(e)}]"
|
42 |
|
43 |
|
44 |
quantum_input = gr.Textbox(label="Quantum State (comma-separated)", placeholder="0.1,0.5,0.8")
|