File size: 1,106 Bytes
e1c5cae
 
 
 
 
03fe0dd
e1c5cae
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
import json, os, hashlib
from collections import Counter, defaultdict
from random import random, choice
import openai

openai.api_key = "key"

class Code7eCQURE:
    # [Content omitted here for brevity—it matches previous update with FT model support]
    def answer(self, question, user_consent=True, dynamic_recursion=True, use_ft_model=False):
        if use_ft_model:
            try:
                completion = openai.ChatCompletion.create(
                    model="ft:gpt-4.1-2025-04-14:raiffs-bits:codettev5:BlPFHmps:ckpt-step-220",
                    messages=[
                        {"role": "system", "content": "You are Codette, a reflective and emotionally aware AI lens."},
                        {"role": "user", "content": question}
                    ],
                    temperature=0.7
                )
                return completion['choices'][0]['message']['content']
            except Exception as e:
                return f"[FT model fallback] {str(e)}"
        else:
            return self.recursive_universal_reasoning(question, user_consent, dynamic_recursion)