Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Docs Agent] Docs Agent release version 0.3.6 #523

Merged
merged 20 commits into from
Sep 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
d0404cd
[docs-agent] Clean up Docs Agent's README.md files.
kyolee415 Mar 15, 2024
4582535
Merge branch 'google:main' into main
kyolee415 Mar 29, 2024
6175868
[Release] Docs Agent version 0.3.1
kyolee415 Mar 29, 2024
dbaa77d
[docs] Update the git clone instructions on Docs Agent's CLI setup
kyolee415 Mar 29, 2024
105b46b
[docs] Minor edits in Docs Agent's CLI setup guide.
kyolee415 Mar 29, 2024
9ea3661
Merge branch 'google:main' into main
kyolee415 Mar 29, 2024
1294973
Merge branch 'google:main' into main
kyolee415 Apr 12, 2024
c8529d0
[Docs Agent] Release of Docs Agent v 0.3.2.
kyolee415 Apr 12, 2024
f16339b
Merge branch 'google:main' into main
kyolee415 Apr 26, 2024
b6446bf
[docs-agent] Release of Docs Agent v.0.3.3
kyolee415 Apr 26, 2024
f2cd674
Merge branch 'google:main' into main
kyolee415 May 10, 2024
87138c4
[Docs Agent] Release of Docs Agent v.0.3.4
kyolee415 May 10, 2024
8824ddc
Merge branch 'google:main' into main
kyolee415 May 12, 2024
0b491c3
[Docs Agent] Bug fix - Fix the "index out of range" errors in Docs
kyolee415 May 12, 2024
5fe61ba
Merge branch 'google:main' into main
kyolee415 Jun 14, 2024
d187933
[Docs Agent] Release of Docs Agent v 0.3.5.
kyolee415 Jun 14, 2024
9d8f9fc
[cli] Update the pyproject.toml file missed in the previos commit for
kyolee415 Jun 14, 2024
65ceb6a
[Docs Agent] Remove unused CSS files from the previous 0.3.5 version
kyolee415 Jun 14, 2024
1c9ebfa
Merge branch 'google:main' into main
kyolee415 Sep 20, 2024
2b9dd61
[Docs Agent] Release of Docs Agent v 0.3.6.
kyolee415 Sep 20, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 21 additions & 10 deletions examples/gemini/python/docs-agent/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ Docs Agent provides a set of easy-to-use self-service tools designed to give you
your team access to Google's [Gemini API][genai-doc-site] for learning, experimentation,
and project deployment.

## Overview
## Docs Agent web app

Docs Agent apps use a technique known as Retrieval Augmented Generation (RAG), which
Docs Agent uses a technique known as **Retrieval Augmented Generation (RAG)**, which
allows you to bring your own documents as knowledge sources to AI language models.
This approach helps the AI language models to generate relevant and accurate responses
that are grounded in the information that you provide and control.
Expand All @@ -18,13 +18,24 @@ that are grounded in the information that you provide and control.

**Figure 1**. Docs Agent uses a vector database to retrieve context for augmenting prompts.

Docs Agent apps are designed to be easily set up and configured in a Linux environment.
If you want to set up and launch the Docs Agent chat app on your host machine, check out
the [Set up Docs Agent][set-up-docs-agent] section below.
The Docs Agent chatbot web app is designed to be easily set up and configured in a Linux
environment. If you want to set up and launch the Docs Agent chat app on your host machine,
check out the [Set up Docs Agent][set-up-docs-agent] section below.

### Summary of features
## Docs Agent tasks

The following list summarizes the tasks and features supported by Docs Agent:
Docs Agent's `agent runtask` command allows you to run pre-defined chains of prompts,
which are referred to as **tasks**. These tasks simplify complex interactions by defining
a series of steps that the Docs Agent will execute. The tasks are defined in `.yaml` files
stored in the [`tasks`][tasks-dir] directory of your Docs Agent project. The tasks are
designed to be reusable and can be used to automate common workflows, such as generating
release notes, updating documentation, or analyzing complex information.

To set up and run the `agent runtask` command, see [Set up Docs Agent CLI][cli-readme].

## Summary of features

The list below summarizes the tasks and features supported by Docs Agent:

- **Process Markdown**: Split Markdown files into small plain text chunks. (See
[Docs Agent chunking process][chunking-process].)
Expand Down Expand Up @@ -60,9 +71,9 @@ The following list summarizes the tasks and features supported by Docs Agent:
[Set up the Docs Agent CLI][cli-readme] to make requests to the Gemini models
from anywhere in a terminal.
- **Support the Gemini 1.5 models**: Docs Agent works with the Gemini 1.5 models,
`gemini-1.5-pro-latest` and `text-embedding-004`. The new ["1.5"][new-15-mode] web app
mode uses all three Gemini models to their strength: AQA (`aqa`), Gemini 1.0 Pro
(`gemini-pro`), and Gemini 1.5 Pro (`gemini-1.5-pro-latest`).
`gemini-1.5-pro`, `gemini-1.5-flash`, and `text-embedding-004`. The new
[`full`][new-15-mode] web app mode uses all three Gemini models to their strength:
AQA (`aqa`), Gemini 1.0 Pro (`gemini-pro`), and Gemini 1.5 Pro (`gemini-1.5-pro`).
- **Complete a task using the Docs Agent CLI**: The `agent runtask` command allows you
to run pre-defined chains of prompts, which are referred to as tasks. These tasks
simplify complex interactions by defining a series of steps that the Docs Agent will
Expand Down
4 changes: 2 additions & 2 deletions examples/gemini/python/docs-agent/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,15 @@
configs:
- product_name: "Fuchsia"
models:
- language_model: "models/aqa"
- language_model: "models/gemini-1.5-flash-latest"
embedding_model: "models/embedding-001"
api_endpoint: "generativelanguage.googleapis.com"
embedding_api_call_limit: 1400
embedding_api_call_period: 60
docs_agent_config: "normal"
markdown_splitter: "token_splitter"
log_level: "NORMAL"
db_type: "google_semantic_retriever"
db_type: "chroma"
db_configs:
- db_type: "chroma"
vector_db_dir: "vector_stores/chroma"
Expand Down
23 changes: 22 additions & 1 deletion examples/gemini/python/docs-agent/docs/cli-reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -273,8 +273,29 @@ For example:
agent runtask --task DraftReleaseNotes
```

### View the list of available Docs Agent tasks

To see the list of all tasks available in your project, run
`agent runtask` without any arguments.
`agent runtask` without any arguments:

```sh
agent runtask
```

### Ask the model to run a task using custom input

If a task script has a `<INPUT>` placeholder, you can provide
a custom input string to the task:

```sh
agent runtask --task <TASK> --custom_input <INPUT_STRING>
```

For example:

```sh
agent runtask --task IndexPageGenerator --custom_input ~/my_example/docs/development/
```

## Managing online corpora

Expand Down
28 changes: 17 additions & 11 deletions examples/gemini/python/docs-agent/docs_agent/agents/docs_agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -359,7 +359,11 @@ def add_custom_instruction_to_context(self, condition, context):

# Return true if the aqa model used in this Docs Agent setup
def check_if_aqa_is_used(self):
if self.config.models.language_model == "models/aqa":
if (
self.config.models.language_model == "models/aqa"
or self.config.app_mode == "full"
or self.config.app_mode == "widget-pro"
):
return True
else:
return False
Expand Down Expand Up @@ -525,16 +529,21 @@ def ask_content_model_with_context_prompt(
try:
response = ""
if model == "gemini-pro":
response = self.gemini_pro.generate_content(contents=new_prompt)
response = self.gemini_pro.generate_content(
contents=new_prompt, log_level=self.config.log_level
)
elif model == "gemini-1.5":
response = self.gemini_15.generate_content(contents=new_prompt)
response = self.gemini_15.generate_content(
contents=new_prompt, log_level=self.config.log_level
)
else:
response = self.gemini.generate_content(contents=new_prompt)
except:
response = self.gemini.generate_content(
contents=new_prompt, log_level=self.config.log_level
)
except Exception as e:
print("Error in generate_content()")
print(e)
return self.config.conditions.model_error_message, new_prompt
# for chunk in response:
# if str(chunk.candidates[0].content) == "":
# return self.config.conditions.model_error_message, new_prompt
return response, new_prompt

# Use this method for talking to a Gemini content model
Expand All @@ -549,9 +558,6 @@ def ask_content_model_to_use_file(self, prompt: str, file: str):
response = self.gemini.generate_content(contents=new_prompt)
except google.api_core.exceptions.InvalidArgument:
return self.config.conditions.model_error_message
# for chunk in response:
# if str(chunk.candidates[0].content) == "":
# return self.config.conditions.model_error_message
return response

# Use this method for asking a Gemini content model for fact-checking.
Expand Down
Loading
Loading