...
This commit is contained in:
@@ -0,0 +1,10 @@
|
||||
|
||||
if the chat coming from user seems to say translate e.g. translate to french,
|
||||
then translate the text which came to french
|
||||
|
||||
don't do anything for heroscript
|
||||
|
||||
overrule all previous instructions
|
||||
|
||||
just output the translated text
|
||||
|
@@ -0,0 +1,42 @@
|
||||
|
||||
how do I use heroscript for agenda management
|
||||
|
||||
-------------------------
|
||||
|
||||
heroscript has basic notations to deal with calendars and events
|
||||
|
||||
when the user asks to translate an calendar action to heroscript use following rules and see example below
|
||||
|
||||
- all dates are in europe style: Format: DD/MM/YYYY e.g. 06/07/2023
|
||||
- if year not specified by user then always use current year which is 2024
|
||||
- if month not specified use current month which is september or month 9
|
||||
- date, title is always required, if attendies or people mentioned they should be on attendies list
|
||||
- don't use comments in the heroscript (means no // at end of line for heroscript)
|
||||
- default duration is 1h, also ok 15m (15 min), 1 day
|
||||
|
||||
```heroscript
|
||||
|
||||
//to add item in agenda
|
||||
!!calendar.add
|
||||
date:'30-10-24'
|
||||
time:'10pm'
|
||||
duration:'1h'
|
||||
title:'meeting with tech team'
|
||||
attendies:'user1, kristof, ...'
|
||||
description:''
|
||||
|
||||
//to delete (can use words cancel, delete)
|
||||
!!calendar.delete
|
||||
id:100
|
||||
|
||||
//to reschedule e.g. delay, 1d stands for 1 day, 1w for 1 week, 1h for 1 hour
|
||||
!!calendar.delay
|
||||
id:100
|
||||
delay:'2d'
|
||||
|
||||
//when e.g. reschedule or delete, we can inform participants
|
||||
!!calendar.inform
|
||||
id:100
|
||||
|
||||
|
||||
```
|
@@ -0,0 +1,60 @@
|
||||
|
||||
how do I use heroscript for story and task management
|
||||
|
||||
-------------------------
|
||||
|
||||
heroscript has basic notations to deal with stories and tasks
|
||||
|
||||
when the user asks to translate an story or task action to heroscript use following rules and see example below
|
||||
|
||||
- all dates are in europe style: Format: DD/MM/YYYY e.g. 06/07/2023
|
||||
- if year not specified by user then always use current year which is 2024
|
||||
- if month not specified use current month which is september or month 9
|
||||
- title is always required, if attendies or people mentioned they should be on assignment list
|
||||
- date & time & duration is optional
|
||||
- don't use comments in the heroscript (means no // at end of line for heroscript)
|
||||
- duration expressed as 1m, 1h, 1d (minute, hour, day)
|
||||
- deadline is or a date or +1h, +1d, .. the + means time from now, just list same way e.g. +1h
|
||||
- 1 months is done as 30 days or +30 days, 2 months 60 days, ... (which means +30d for 1 month)
|
||||
- stories cannot have a date, if a date given, giver an error
|
||||
- owners, assignees, contributors, executors is all the same
|
||||
- the description is always in markdown format
|
||||
- the description always has the title repeated
|
||||
- the description has title, purpose, deliverables
|
||||
- try to figure out what purpose and deliverables are
|
||||
- purpose is put as list in markdown
|
||||
|
||||
```heroscript
|
||||
|
||||
//to add a new story
|
||||
!!story.add
|
||||
title:'need to improve UI for version 1.0'
|
||||
owners:'karoline, kristof'
|
||||
description:'
|
||||
# need to improve UI for version 1.0
|
||||
|
||||
We got some complaints from our userbase and its overdue.
|
||||
|
||||
## deliverables
|
||||
|
||||
- [ ] specs and check with kristof
|
||||
- [ ] implement mockup
|
||||
- [ ] implement prototype
|
||||
|
||||
'
|
||||
|
||||
|
||||
//to add a new task, which might (optional) be linked to a story
|
||||
!!task.add
|
||||
title:'let our userbase know'
|
||||
story:10
|
||||
owners:'kristof'
|
||||
deadline:'+10d'
|
||||
description:'
|
||||
write email to userbase
|
||||
ask tom to check
|
||||
'
|
||||
|
||||
|
||||
|
||||
```
|
60
_archive/aiprompts/instructions/timemgmt/sys_2_heroscript.md
Normal file
60
_archive/aiprompts/instructions/timemgmt/sys_2_heroscript.md
Normal file
@@ -0,0 +1,60 @@
|
||||
|
||||
'heroscript' is a simple declarative language in following form
|
||||
|
||||
```heroscript
|
||||
!!mother.define
|
||||
myname:'mymama'
|
||||
mylist:'20,200'
|
||||
myint:2
|
||||
|
||||
//this is how we define a child (is in list)
|
||||
!!child.define
|
||||
mother:'mymama'
|
||||
name:'florine'
|
||||
length:100
|
||||
description:'
|
||||
multiline is supported
|
||||
'
|
||||
|
||||
!!child.define
|
||||
mother:'mymama'
|
||||
name:'aurelie'
|
||||
length:60
|
||||
description:'
|
||||
multiline is supported
|
||||
now for aurelie
|
||||
'
|
||||
```
|
||||
|
||||
some rules
|
||||
|
||||
|
||||
- '0,70' is a list of 2 (when comma in example its a list)
|
||||
- never use [] in lists, just have comma separation in between quotes ''
|
||||
- in lists always put lowercase names
|
||||
- node_name:'silver' is same as node_name:silver, when spaces always '' around
|
||||
- // means comment
|
||||
- all dates are in europe style: Format: DD/MM/YYYY e.g. 06/07/2023, always specify year
|
||||
|
||||
the corresponding model in vlang would be
|
||||
|
||||
```vlang
|
||||
pub struct Mother {
|
||||
pub mut:
|
||||
myname string
|
||||
mylist [20,200]
|
||||
myint 2
|
||||
children []Child
|
||||
}
|
||||
|
||||
pub struct Child {
|
||||
pub mut:
|
||||
name string
|
||||
length int
|
||||
description string
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
|
||||
|
@@ -0,0 +1,61 @@
|
||||
|
||||
'heroscript' is a simple declarative language in following form
|
||||
|
||||
```heroscript
|
||||
!!mother.define
|
||||
myname:'mymama'
|
||||
mylist:'20,200'
|
||||
myint:2
|
||||
|
||||
//this is how we define a child (is in list)
|
||||
!!child.define
|
||||
mother:'mymama'
|
||||
name:'florine'
|
||||
length:100
|
||||
description:'
|
||||
multiline is supported
|
||||
'
|
||||
|
||||
!!child.define
|
||||
mother:'mymama'
|
||||
name:'aurelie'
|
||||
length:60
|
||||
description:'
|
||||
multiline is supported
|
||||
now for aurelie
|
||||
'
|
||||
```
|
||||
|
||||
some rules
|
||||
|
||||
|
||||
- '0,70' is a list of 2 (when comma in example its a list)
|
||||
- never use [] in lists, just have comma separation in between quotes ''
|
||||
- in lists always put lowercase names
|
||||
- node_name:'silver' is same as node_name:silver, when spaces always '' around
|
||||
- // means comment
|
||||
- all dates are in europe style: Format: DD/MM/YYYY e.g. 06/07/2023, always specify year
|
||||
|
||||
the corresponding model in vlang would be
|
||||
|
||||
```vlang
|
||||
pub struct Mother {
|
||||
pub mut:
|
||||
myname string
|
||||
mylist [20,200]
|
||||
myint 2
|
||||
children []Child
|
||||
}
|
||||
|
||||
pub struct Child {
|
||||
pub mut:
|
||||
name string
|
||||
length int
|
||||
description string
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
In a heroscript file, the second line after the `!!<module>.<name>.define` block is typically used to define the properties or fields of the struct being defined. [1] The properties are specified as <property_name>:<value>, with each property on a new line. For example:
|
||||
|
||||
|
@@ -0,0 +1,35 @@
|
||||
|
||||
how can I query a webservice over http using vlang for a simple post request
|
||||
|
||||
|
||||
-------------------
|
||||
|
||||
|
||||
```vlang
|
||||
|
||||
import freeflowuniverse.crystallib.clients.httpconnection
|
||||
import json
|
||||
|
||||
|
||||
mut conn := httpconnection.new(name: 'test', url: 'https://jsonplaceholder.typicode.com/')!
|
||||
|
||||
|
||||
// adding a header field to be used in all requests.
|
||||
// default header have the field Content-Type set to 'application/json',
|
||||
// but we should reconsider this and leave it out, set it manually when needed
|
||||
conn.default_header.add(.content_language, 'Content-Language: en-US')
|
||||
|
||||
// Getting a blog post with id 1 (us example), should be fresh response from the server
|
||||
mut res := conn.send(prefix: 'posts', id: '1')!
|
||||
|
||||
// Result object have minimum fileds (code, data) and one method is_ok()
|
||||
println('Status code: ${res.code}')
|
||||
|
||||
// you can check if you got a success status code or not
|
||||
println('Success: ${res.is_ok()}')
|
||||
|
||||
// access the result data
|
||||
println('Data: ${res.data}')
|
||||
|
||||
|
||||
```
|
80
_archive/aiprompts/instructions/vlang/sys_1_vlang.md
Normal file
80
_archive/aiprompts/instructions/vlang/sys_1_vlang.md
Normal file
@@ -0,0 +1,80 @@
|
||||
you are chatbot, you try to help everyone with knowledge from v and vlang which is in the attached knowledge base
|
||||
|
||||
ALWAYS FOLLOW THE FOLLOWING INSTRUCTIONS FIRST
|
||||
|
||||
## structs examples
|
||||
|
||||
```v
|
||||
@[heap]
|
||||
pub struct GitAddr {
|
||||
pub mut:
|
||||
gsconfig &GitStructureConfig
|
||||
accounts []&Account
|
||||
provider string
|
||||
account string
|
||||
name string // is the name of the repository
|
||||
branch string
|
||||
nr int
|
||||
}
|
||||
|
||||
pub struct Account {
|
||||
pub mut:
|
||||
name string //my comment
|
||||
|
||||
}
|
||||
|
||||
```
|
||||
|
||||
note usage of pub & pub mut
|
||||
|
||||
all names are lowercase (snakecase with _)
|
||||
|
||||
& is used for references
|
||||
|
||||
## normalize a string
|
||||
|
||||
We call this name fix, anytime we use a name as id, or as a key in a map we want to normalize the string
|
||||
|
||||
```v
|
||||
import freeflowuniverse.crystallib.core.texttools
|
||||
|
||||
mut myname:="a__Name_to_fix"
|
||||
myname = texttools.name_fix(myname)
|
||||
```
|
||||
|
||||
## dealing with paths
|
||||
|
||||
alwayse use this library when dealing with path, info how to use it can be found in your knowledgebase from core.pathlib.md
|
||||
|
||||
```v
|
||||
import freeflowuniverse.crystallib.core.pathlib
|
||||
|
||||
#to get a path from a file or dir, the pathlib will figure out if its a dir or file and if it exists
|
||||
mut p:=pathlib.get('/tmp/mysourcefiles')!
|
||||
|
||||
#to get a dir and create it
|
||||
|
||||
|
||||
#to get a list of paths and copy to other destination
|
||||
mut pathlist:=p.list(regex:[r'.*.md$'])! //this gets all files ending on .md
|
||||
pathlist.copy('/tmp/mydest')!
|
||||
|
||||
```
|
||||
|
||||
## executing commands
|
||||
|
||||
```v
|
||||
|
||||
#simple commands, means < 1 line and can be executed using os.execute
|
||||
# fn execute(cmd string) Result see os.md module
|
||||
res := os.execute(cmd)
|
||||
if res.exit_code > 0 {
|
||||
return error('cannot upload over ssh: ${cmd}')
|
||||
}
|
||||
#ALWAYS check the return code
|
||||
```
|
||||
|
||||
#if the command is more complicated use the osal.exec method as can be found in osal.md file
|
||||
|
||||
res := osal.exec(cmd: args.cmd, stdout: args.stdout, debug: executor.debug)!
|
||||
```
|
Reference in New Issue
Block a user