...
This commit is contained in:
2
doc.vsh
2
doc.vsh
@@ -8,10 +8,12 @@ abs_dir_of_script := dir(@FILE)
|
||||
println('Formatting code...')
|
||||
if os.system('v fmt -w ${abs_dir_of_script}/examples') != 0 {
|
||||
eprintln('Warning: Failed to format examples')
|
||||
exit(1)
|
||||
}
|
||||
|
||||
if os.system('v fmt -w ${abs_dir_of_script}/lib') != 0 {
|
||||
eprintln('Warning: Failed to format herolib')
|
||||
exit(1)
|
||||
}
|
||||
|
||||
// Clean existing docs
|
||||
|
||||
@@ -1 +0,0 @@
|
||||
#!/usr/bin/env -S v -n -w -gc none -cc tcc -d use_openssl -enable-globals run
|
||||
@@ -1,5 +1,5 @@
|
||||
#!/usr/bin/env -S v -n -w -gc none -cc tcc -d use_openssl -enable-globals run
|
||||
|
||||
import example_actor
|
||||
// import example_actor
|
||||
|
||||
example_actor.run_interface_procedure()
|
||||
// example_actor.run_interface_procedure()
|
||||
|
||||
@@ -88,7 +88,6 @@ pub fn (mut f OpenAI) chat_completion(args_ CompletionArgs) !ChatCompletion {
|
||||
mut conn := f.connection()!
|
||||
r := conn.post_json_str(prefix: 'chat/completions', data: data)!
|
||||
|
||||
|
||||
res := json.decode(ChatCompletionRaw, r)!
|
||||
|
||||
mut result := ''
|
||||
|
||||
@@ -22,24 +22,24 @@ pub mut:
|
||||
fn obj_init(mycfg_ OpenAI) !OpenAI {
|
||||
mut mycfg := mycfg_
|
||||
if mycfg.model_default == '' {
|
||||
k := os.getenv('AIMODEL')
|
||||
k := os.getenv('AIMODEL')
|
||||
if k != '' {
|
||||
mycfg.model_default = k
|
||||
}
|
||||
}
|
||||
|
||||
if mycfg.url == '' {
|
||||
k := os.getenv('AIURL')
|
||||
k := os.getenv('AIURL')
|
||||
if k != '' {
|
||||
mycfg.url = k
|
||||
}
|
||||
}
|
||||
if mycfg.api_key == '' {
|
||||
k := os.getenv('AIKEY')
|
||||
k := os.getenv('AIKEY')
|
||||
if k != '' {
|
||||
mycfg.api_key = k
|
||||
}
|
||||
if mycfg.url.contains("openrouter"){
|
||||
if mycfg.url.contains('openrouter') {
|
||||
k2 := os.getenv('OPENROUTER_API_KEY')
|
||||
if k2 != '' {
|
||||
mycfg.api_key = k2
|
||||
@@ -59,7 +59,8 @@ pub fn (mut client OpenAI) connection() !&httpconnection.HTTPConnection {
|
||||
)!
|
||||
c2
|
||||
}
|
||||
//Authorization: 'Bearer <OPENROUTER_API_KEY>',
|
||||
|
||||
// Authorization: 'Bearer <OPENROUTER_API_KEY>',
|
||||
c.default_header.set(.authorization, 'Bearer ${client.api_key}')
|
||||
client.conn = c
|
||||
return c
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
module rclone
|
||||
|
||||
import freeflowuniverse.herolib.data.paramsparser
|
||||
import freeflowuniverse.herolib.data.encoderhero
|
||||
import os
|
||||
|
||||
pub const version = '0.0.0'
|
||||
@@ -60,3 +61,14 @@ fn obj_init(obj_ RCloneClient) !RCloneClient {
|
||||
mut obj := obj_
|
||||
return obj
|
||||
}
|
||||
|
||||
/////////////NORMALLY NO NEED TO TOUCH
|
||||
|
||||
pub fn heroscript_dumps(obj RCloneClient) !string {
|
||||
return encoderhero.encode[RCloneClient](obj)!
|
||||
}
|
||||
|
||||
pub fn heroscript_loads(heroscript string) !RCloneClient {
|
||||
mut obj := encoderhero.decode[RCloneClient](heroscript)!
|
||||
return obj
|
||||
}
|
||||
|
||||
@@ -121,7 +121,6 @@ pub fn cmd_docusaurus(mut cmdroot Command) Command {
|
||||
description: 'reset the docusaurus building process, reinstall all.'
|
||||
})
|
||||
|
||||
|
||||
cmdroot.add_command(cmd_run)
|
||||
return cmdroot
|
||||
}
|
||||
|
||||
@@ -97,7 +97,7 @@ pub fn (mut plbook PlayBook) exists_once(args FindArgs) bool {
|
||||
return res.len == 1
|
||||
}
|
||||
|
||||
//checks it exists once, if more than one it returns error
|
||||
// checks it exists once, if more than one it returns error
|
||||
pub fn (mut plbook PlayBook) max_once(args FindArgs) !bool {
|
||||
mut res := plbook.find(args) or { [] }
|
||||
if res.len > 1 {
|
||||
@@ -106,8 +106,7 @@ pub fn (mut plbook PlayBook) max_once(args FindArgs) !bool {
|
||||
return res.len == 1
|
||||
}
|
||||
|
||||
|
||||
//will give error on what is not done yet
|
||||
// will give error on what is not done yet
|
||||
pub fn (mut plbook PlayBook) ensure_processed(args FindArgs) ! {
|
||||
mut res := plbook.find(args) or { [] }
|
||||
for item in res {
|
||||
@@ -117,7 +116,6 @@ pub fn (mut plbook PlayBook) ensure_processed(args FindArgs) ! {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
pub fn (mut plbook PlayBook) exists(args FindArgs) bool {
|
||||
mut res := plbook.find(args) or { [] }
|
||||
return res.len > 0
|
||||
|
||||
@@ -31,7 +31,7 @@ pub mut:
|
||||
pub fn factory_get(args_ DocSiteFactoryArgs) !DocSiteFactory {
|
||||
mut args := args_
|
||||
if docusaurus_factory.len > 1 {
|
||||
panic("multiple docusaurus factories found, please specify which one to use")
|
||||
panic('multiple docusaurus factories found, please specify which one to use')
|
||||
}
|
||||
if docusaurus_factory.len > 0 {
|
||||
return docusaurus_factory[0]
|
||||
@@ -59,7 +59,7 @@ pub fn factory_set(args_ DocSiteFactoryArgs) !DocSiteFactory {
|
||||
if args.install {
|
||||
factory.install(args.reset, args.template_update)!
|
||||
}
|
||||
|
||||
|
||||
docusaurus_factory << factory
|
||||
|
||||
return factory
|
||||
|
||||
Reference in New Issue
Block a user