Backend: - cockpit_chat.dspy: real LLM calls via llm table config, Hermes-style context (system prompt + project/iteration + history), auto model selection (multimodal if files, text otherwise) - cockpit_model_options.dspy: returns active models with capabilities - llm table: added capabilities column (text/vision/multimodal) Frontend: - inputed script: no page reload, updates agent bubble with LLM reply - stats_row refreshed on success, error shown in bubble DB: - sd_agent_settings table for per-user agent preferences
52 lines
872 B
Plaintext
52 lines
872 B
Plaintext
|
|
ns = params_kw.copy()
|
|
for k,v in ns.items():
|
|
if v == 'NaN' or v == 'null':
|
|
ns[k] = None
|
|
id = params_kw.id
|
|
if not id or len(id) > 32:
|
|
id = uuid()
|
|
ns['id'] = id
|
|
|
|
|
|
|
|
userorgid = await get_userorgid()
|
|
if not userorgid:
|
|
return {
|
|
"widgettype":"Error",
|
|
"options":{
|
|
"title":"Authorization Error",
|
|
"timeout":3,
|
|
"cwidth":16,
|
|
"cheight":9,
|
|
"message":"Please login"
|
|
}
|
|
}
|
|
ns['org_id'] = userorgid
|
|
ns['created_by'] = userorgid
|
|
|
|
db = DBPools()
|
|
dbname = get_module_dbname('pipeline_sdlc')
|
|
async with db.sqlorContext(dbname) as sor:
|
|
r = await sor.C('sd_projects', ns.copy())
|
|
return {
|
|
"widgettype":"Message",
|
|
"options":{
|
|
"cwidth":16,
|
|
"cheight":9,
|
|
"title":"Add Success",
|
|
"timeout":3,
|
|
"message":"ok"
|
|
}
|
|
}
|
|
|
|
return {
|
|
"widgettype":"Error",
|
|
"options":{
|
|
"title":"Add Error",
|
|
"cwidth":16,
|
|
"cheight":9,
|
|
"timeout":3,
|
|
"message":"failed"
|
|
}
|
|
} |