From 3bca5f661e9fc28451c069cfa66d5f6280ccfafa Mon Sep 17 00:00:00 2001 From: despiegk Date: Wed, 6 Aug 2025 12:50:30 +0200 Subject: [PATCH] ... --- examples/clients/aiclient_example.vsh | 4 ++-- lib/clients/openai/completions.v | 3 --- lib/clients/openai/openai_factory_.v | 2 +- lib/clients/openai/openai_model.v | 2 +- 4 files changed, 4 insertions(+), 7 deletions(-) diff --git a/examples/clients/aiclient_example.vsh b/examples/clients/aiclient_example.vsh index e4e4e02b..8b537e30 100755 --- a/examples/clients/aiclient_example.vsh +++ b/examples/clients/aiclient_example.vsh @@ -13,8 +13,8 @@ playcmds.run( mut client := openai.get()! mut r := client.chat_completion( - model: 'gpt-3.5-turbo' + model: 'gpt-oss-20b' message: 'Hello, world!' - temperature: 0.5 + temperature: 0.3 max_completion_tokens: 1024 )! diff --git a/lib/clients/openai/completions.v b/lib/clients/openai/completions.v index 720bc161..04239b21 100644 --- a/lib/clients/openai/completions.v +++ b/lib/clients/openai/completions.v @@ -86,10 +86,7 @@ pub fn (mut f OpenAI) chat_completion(args_ CompletionArgs) !ChatCompletion { data := json.encode(m) // println('data: ${data}') mut conn := f.connection()! - println(f) r := conn.post_json_str(prefix: 'chat/completions', data: data)! - println('res: ${r}') - if true{panic("TO DEBUG, SOMETHING IS NOT RIGHT IN LINE WITH AUTHENTICATION")} res := json.decode(ChatCompletionRaw, r)! diff --git a/lib/clients/openai/openai_factory_.v b/lib/clients/openai/openai_factory_.v index 83b9189a..8aeb1af6 100644 --- a/lib/clients/openai/openai_factory_.v +++ b/lib/clients/openai/openai_factory_.v @@ -82,7 +82,7 @@ pub fn play(mut plbook PlayBook) ! { mut install_actions := plbook.find(filter: 'openai.configure')! if install_actions.len > 0 { for install_action in install_actions { - println('install_action: ${install_action}') + // println('install_action: ${install_action}') heroscript := install_action.heroscript() mut obj2 := heroscript_loads(heroscript)! set(obj2)! diff --git a/lib/clients/openai/openai_model.v b/lib/clients/openai/openai_model.v index 9e7d849a..b565640c 100644 --- a/lib/clients/openai/openai_model.v +++ b/lib/clients/openai/openai_model.v @@ -39,7 +39,7 @@ fn obj_init(mycfg_ OpenAI) !OpenAI { if k != '' { mycfg.api_key = k } - if k == '' { + if mycfg.url.contains("openrouter"){ k2 := os.getenv('OPENROUTER_API_KEY') if k2 != '' { mycfg.api_key = k2