...
This commit is contained in:
17
examples/ai/aiclient.vsh
Executable file
17
examples/ai/aiclient.vsh
Executable file
@@ -0,0 +1,17 @@
|
||||
#!/usr/bin/env -S v -n -w -gc none -cc tcc -d use_openssl -enable-globals run
|
||||
|
||||
import incubaid.herolib.ai.client
|
||||
|
||||
mut cl := client.new()!
|
||||
|
||||
// response := cl.llms.llm_local.chat_completion(
|
||||
// message: 'Explain quantum computing in simple terms'
|
||||
// temperature: 0.5
|
||||
// max_completion_tokens: 1024
|
||||
// )!
|
||||
|
||||
response := cl.llms.llm_embed_local.embed(input: [
|
||||
'The food was delicious and the waiter..',
|
||||
])!
|
||||
|
||||
println(response)
|
||||
@@ -1,7 +1,5 @@
|
||||
#!/usr/bin/env -S v -n -w -gc none -cc tcc -d use_openssl -enable-globals run
|
||||
|
||||
module main
|
||||
|
||||
import incubaid.herolib.clients.openai
|
||||
import os
|
||||
import incubaid.herolib.core.playcmds
|
||||
@@ -10,8 +8,8 @@ import incubaid.herolib.core.playcmds
|
||||
|
||||
playcmds.run(
|
||||
heroscript: '
|
||||
!!openai.configure name:"groq"
|
||||
url:"https://api.groq.com/openai/v1"
|
||||
!!openai.configure name:"groq"
|
||||
url:"https://api.groq.com/openai/v1"
|
||||
model_default:"openai/gpt-oss-120b"
|
||||
'
|
||||
reset: true
|
||||
|
||||
Reference in New Issue
Block a user