Skip to content

Commit b6a2bd9

Browse files
committed
[Docs Agent] Docs Agent release version 0.4.0
- **Multi-modal support:** The Docs Agent CLI supports image, audio, and video files as part of a prompt to the Gemini model. - **Formatted output:** Select the format of Docs Agent CLI's responses with the `--response_type json` and `--plaintext` options. - **Autocomplete script:** The `autocomplete.sh` script is added to include Docs Agent CLI commands and options, making it easier and faster to use the Docs Agent CLI on a terminal.
1 parent 213c6ce commit b6a2bd9

File tree

6 files changed

+182
-176
lines changed

6 files changed

+182
-176
lines changed

examples/gemini/python/docs-agent/docs_agent/models/palm.py

Lines changed: 0 additions & 176 deletions
This file was deleted.
Lines changed: 99 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,99 @@
1+
_script()
2+
{
3+
local cur preset_list
4+
5+
preset_list="
6+
agent
7+
--help
8+
backup-chroma
9+
benchmark
10+
chatbot
11+
--hostname
12+
--port
13+
--debug
14+
--app_mode
15+
web
16+
full
17+
widget
18+
widget-pro
19+
experimental
20+
--enable_show_logs
21+
--enable_logs_to_markdown
22+
--config_file
23+
--product
24+
chunk
25+
cleanup-dev
26+
delete-corpus
27+
get-all-docs
28+
helpme
29+
--new
30+
--cont
31+
--file
32+
--allfiles
33+
--perfile
34+
--response_type
35+
json
36+
x.enum
37+
text
38+
list-corpora
39+
open-corpus
40+
populate
41+
posix
42+
remove-corpus-permission
43+
runtask
44+
share-corpus
45+
--name
46+
--email
47+
--role
48+
--config_file
49+
show-config
50+
show-session
51+
tellme
52+
write-logs-to-csv
53+
runtask
54+
--task
55+
--model
56+
--custom_input
57+
--plaintext
58+
--force
59+
--task_config
60+
CheckCommitForDocUpdate
61+
ExtractWorkflows
62+
GenerateDocSet
63+
DevSiteYAMLGenerator
64+
HelpPolishPrompts
65+
DraftReleaseNotes
66+
ExamineChangesBetweenTwoCommits
67+
ReviseContentStructure
68+
IndexPageGenerator
69+
DraftFuchsiaReleaseNotes
70+
DraftPSA
71+
PreparePodcasteFromDir
72+
DescribeImages
73+
DescribeImagesWithoutMarkdown
74+
models/gemini-1.5-flash
75+
models/gemini-1.5-flash-latest
76+
models/gemini-1.5-flash-001
77+
models/gemini-1.5-flash-002
78+
models/gemini-1.5-flash-8b
79+
models/gemini-1.5-flash-8b-latest
80+
models/gemini-1.5-flash-8b-001
81+
models/gemini-1.5-pro
82+
models/gemini-1.5-pro-latest
83+
models/gemini-1.5-pro-001
84+
models/gemini-1.5-pro-002
85+
models/gemini-1.5-pro-exp-0827
86+
models/gemini-1.0-pro
87+
models/gemini-1.0-pro-latest
88+
models/gemini-1.0-pro-001
89+
models/aqa
90+
"
91+
92+
COMPREPLY=()
93+
cur="${COMP_WORDS[COMP_CWORD]}"
94+
COMPREPLY=( $(compgen -W "${preset_list}" -- ${cur}) )
95+
96+
return 0
97+
}
98+
complete -o filenames -o nospace -o default -F _script agent
99+
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
tasks:
2+
- name: "DescribeImagesWithoutMarkdown"
3+
model: "models/gemini-1.5-flash"
4+
description: "An agent that describes each image in the input directory to help write alt text."
5+
preamble: "When describing an image, keep it short and concise, and focus on the essence of the image."
6+
steps:
7+
- prompt: "Provide a concise, descriptive alt text for this JPEG image that captures its essence and is suitable for users with visual impairments."
8+
flags:
9+
perfile: "<INPUT>"
10+
default_input: "./docs"
11+
file_ext: "jpg"
12+
- prompt: "Provide a concise, descriptive alt text for this PNG image that captures its essence and is suitable for users with visual impairments."
13+
flags:
14+
perfile: "<INPUT>"
15+
default_input: "./docs"
16+
file_ext: "png"
17+
- prompt: "Provide a concise, descriptive alt text for this GIF image that captures its essence and is suitable for users with visual impairments."
18+
flags:
19+
perfile: "<INPUT>"
20+
default_input: "./docs"
21+
file_ext: "gif"
22+
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
tasks:
2+
- name: "DescribeImages"
3+
model: "models/gemini-1.5-flash"
4+
description: "An agent that describes each image in the input directory to help write alt text."
5+
preamble: "When describing an image, limit the description to 80 or less characters."
6+
steps:
7+
- prompt: "Provide a brief description of each Markdown file in this directory, emphasizing the key content and purpose of each file."
8+
flags:
9+
allfiles: "<INPUT>"
10+
default_input: "./docs"
11+
file_ext: "md"
12+
- prompt: "Using the Markdown descriptions as context, provide a concise, descriptive alt text for this JPEG image that captures its essence and is suitable for users with visual impairments."
13+
flags:
14+
perfile: "<INPUT>"
15+
default_input: "./docs"
16+
file_ext: "jpg"
17+
- prompt: "Using the Markdown descriptions as context, provide a concise, descriptive alt text for this PNG image that captures its essence and is suitable for users with visual impairments."
18+
flags:
19+
perfile: "<INPUT>"
20+
default_input: "./docs"
21+
file_ext: "png"
22+
- prompt: "Using the Markdown descriptions as context, provide a concise, descriptive alt text for this GIF image that captures its essence and is suitable for users with visual impairments."
23+
flags:
24+
perfile: "<INPUT>"
25+
default_input: "./docs"
26+
file_ext: "gif"
27+
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
tasks:
2+
- name: "PreparePodcasteFromDir"
3+
model: "models/gemini-1.5-pro-latest"
4+
description: "An agent that helps prepare a podcast from a directory of markdown files."
5+
preamble: "When writing a prompt, always be direct and concise."
6+
steps:
7+
- prompt: "Read these documentation files and create a markdown document
8+
that highlights the parts that are to the most interesting to talk
9+
about in a podcast. Make sure to also include
10+
interesting topics to talk about. Most listeners will be software
11+
engineers, so make sure to highlight technical topics. Also make sure
12+
the conversation flows well and is centered around using tooling
13+
when possible. You should list at least 5 high level topics to talk about.
14+
At the top of the file include the text: \"Use this script to organize
15+
the podcast show that you are about to record.\""
16+
flags:
17+
allfiles: "<INPUT>"
18+
default_input: "~/docs/"
19+
file_ext: "md"
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
tasks:
2+
- name: "ReviseContentStructure"
3+
model: "models/gemini-1.5-flash"
4+
description: "An agent that helps revise content structure in a doc for better flow and readability."
5+
preamble: "You're an editor specializing in revising technical documents. When generating a Markdown file, limit the number of characters per line to 80 or less, and keep the unchanged content in tact."
6+
steps:
7+
- prompt: "Summarize the key information and purpose of the content in the provided file."
8+
flags:
9+
file: "<INPUT>"
10+
default_input: "./README.md"
11+
- prompt: "Identify the key topics and subjects discussed in the provided file. Present your findings as a numbered list of bullet points, ensuring clarity and conciseness."
12+
- prompt: "Based on the extracted key topics and subjects, propose a logical and engaging narrative structure for the provided file. Consider the natural flow of information and prioritize clarity and readability. Present your proposal as a numbered list."
13+
- prompt: "Review the section titles in the provided file and suggest any updates for overall clarity and consistency. Present your suggestions as a numbered list with the original title, followed by your proposed title."
14+
- prompt: "Rewrite the provided file, incorporating the proposed narrative structure and making necessary adjustments to improve the flow and readability of the document."
15+

0 commit comments

Comments
 (0)