Skip to content

Commit

Permalink
feat(guide): select a file from dir
Browse files Browse the repository at this point in the history
  • Loading branch information
snowyu committed Sep 1, 2024
1 parent be20e9b commit 6a62b76
Showing 1 changed file with 15 additions and 14 deletions.
29 changes: 15 additions & 14 deletions guide/guide_lib_select.ai.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,24 +6,25 @@ description: |-
input:
- dir: {type: ['string', 'array']}
- extname: {type: ['string', 'array']}
- lang
output:
type: 'string'
instruction: |-
- Summary the key points and essence of it
- Extract all links with title and description base on the markdown links from it
dir: "../examples"
extname: ".ai.yaml"
extname:
- ".ai.yaml"
- ".ai.yml"
autoRunLLMIfPromptAvailable: false
memoized: false
---
# - system: |-
# - Summarize the following file provided by the user in detail, capturing the key points and essence of it.
# - Extract all links with title and description base on the markdown links in the file
# - Output JSON format, following the JSON schema:
# {{output}}
# ---
# @file({{__dirname + file}})
# - user: Output all urls with title in markdown format from the README.md
# - assistant: "[[urls:temperature=0.01]]"
# - -> summary(file={{__dirname + file}}, content)
- -> summary(file={{__dirname + file}}, content=instruction) -> json(output=output)
# - $|echo: ["summary", "links[0]"]

# - -> trans(content="Please select a file:", lang) -> $set('question')
- $set('question', "Please select a file:")
- -> $listFilenames(dir=__dirname+dir, extname=extname) -> $set('files')
- $if: "this.files?.length > 0"
then:
- -> input(inputType='AutoComplete', content=question, choices=files, limit=10, memoized=false) -> $echo(content=dir+'/'+content)
# - -> guide_lib_explain(file=content, lang=preferLang)
else:
- $throw("no files")

0 comments on commit 6a62b76

Please sign in to comment.