Raiff1982 commited on
Commit
24fcefa
·
verified ·
1 Parent(s): ca5ee4f

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +16 -2
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
- # Placeholder response logic (can be replaced with actual Codette core integration)
27
- return f"Codette: I see you said '{input_text}'. Let's reflect together..."
 
 
 
 
 
 
 
 
 
 
 
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")