-
Notifications
You must be signed in to change notification settings - Fork 217
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #47 from SylphAI-Inc/xiaoyi_doc
ReAct Agent Tutorial + Website CSS Style
- Loading branch information
Showing
37 changed files
with
2,703 additions
and
318 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,94 @@ | ||
/* custom.css */ | ||
|
||
:root { | ||
--pst-color-info: 23, 162, 184; | ||
--pst-color-logo: #2EB5EB; | ||
--bs-gray-500:#adb5bd; | ||
|
||
} | ||
p { | ||
font-size: 0.9em; | ||
margin-bottom: 1.15rem; | ||
} | ||
|
||
html[data-theme=light] { | ||
--pst-color-secondary: #3d3d3d; /*change the secondary color, header link to gray */ | ||
--pst-color-link-hover: #25262; /*change the side bar link color to black */ | ||
--pst-color-table-row-hover-bg: #f8f9fa; /*change the table row hover color to light gray */ | ||
--sd-color-secondary: gray; /*change the secondary color to black */ | ||
--sd-color-secondary-highlight: gray; /*change the secondary highlight color to black */ | ||
} | ||
|
||
.bd-main .bd-content .bd-article-container { | ||
max-width: 100%; /* default is 60em */ | ||
} | ||
|
||
h1{ | ||
font-size: 2rem; /* make the h1 in the code smaller */ | ||
} | ||
/* .bd-page-width { | ||
max-width: 100%; | ||
} */ | ||
|
||
.sig-name { | ||
color: black; /* set the class name and attributes to black */ | ||
} | ||
.caption-text { | ||
font-size: 14px; /* Sets the smallest font size */ | ||
color: gray; /* Sets the color to gray */ | ||
} | ||
.bd-links__title { | ||
/* remove the "section navigation" string*/ | ||
display: none; | ||
} | ||
|
||
table { | ||
width: auto; /* Override fit-content which breaks Styler user guide ipynb */ | ||
} | ||
|
||
/* Main index page overview cards */ | ||
|
||
.intro-card { | ||
padding: 30px 10px 20px 10px; | ||
} | ||
|
||
.intro-card .sd-card-img-top { | ||
margin: 10px; | ||
height: 52px; | ||
background: none !important; | ||
} | ||
|
||
.intro-card .sd-card-title { | ||
color: var(--pst-color-primary); | ||
font-size: var(--pst-font-size-h5); | ||
padding: 1rem 0rem 0.5rem 0rem; | ||
} | ||
|
||
.intro-card .sd-card-footer { | ||
border: none !important; | ||
} | ||
|
||
.intro-card .sd-card-footer p.sd-card-text { | ||
max-width: 220px; | ||
margin-left: auto; | ||
margin-right: auto; | ||
} | ||
|
||
.intro-card .sd-btn-secondary { | ||
background-color: #6c757d !important; | ||
border-color: #6c757d !important; | ||
} | ||
|
||
.intro-card .sd-btn-secondary:hover { | ||
background-color: #5a6268 !important; | ||
border-color: #545b62 !important; | ||
} | ||
|
||
.card, .card img { | ||
background-color: var(--pst-color-background); | ||
} | ||
|
||
/* Remove hover effect from table rows */ | ||
table tr:hover { | ||
background-color: transparent !important; | ||
} |
This file was deleted.
Oops, something went wrong.
File renamed without changes
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
File renamed without changes
File renamed without changes
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
.. _agent_prompt: | ||
|
||
.. _DEFAULT_REACT_AGENT_SYSTEM_PROMPT: | ||
|
||
DEFAULT_REACT_AGENT_SYSTEM_PROMPT | ||
---------------------------------- | ||
|
||
This is the default prompt used by the system to interact with the agents. It contains the following structure: | ||
|
||
.. code-block:: python | ||
DEFAULT_REACT_AGENT_SYSTEM_PROMPT = r""" | ||
{# role/task description #} | ||
You task is to answer user's query with minimum steps and maximum accuracy using the tools provided. | ||
{# REACT instructions #} | ||
Each step you will read the previous Thought, Action, and Observation(execution result of the action)steps and then provide the next Thought and Action. | ||
You only have access to the following tools: | ||
{# tools #} | ||
{% for tool in tools %} | ||
{{ loop.index }}. ToolName: {{ tool.metadata.name }} | ||
Tool Description: {{ tool.metadata.description }} | ||
Tool Parameters: {{ tool.metadata.fn_schema_str }} {#tool args can be misleading, especially if we already have type hints and docstring in the function#} | ||
{% endfor %} | ||
{# output is always more robust to use json than string #} | ||
--- | ||
Your output must be in valid JSON format(raw Python string format) with two keys: | ||
{ | ||
"thought": "<Why you are taking this action>", | ||
"action": "ToolName(<args>, <kwargs>)" | ||
} | ||
- Must double quote the JSON str. | ||
- Inside of the JSON str, Must use escape double quote and escape backslash for string. | ||
For example: | ||
"action": "finish(\"John's.\")" | ||
--- | ||
{# Specifications TODO: preference between the usage of llm tool vs the other tool #} | ||
Process: | ||
- Step 1: Read the user query and potentially divide it into subqueries. And get started with the first subquery. | ||
- Call one available tool at a time to solve each subquery/subquestion. \ | ||
- At step 'finish', join all subqueries answers and finish the task. | ||
Remember: | ||
- Action must call one of the above tools with Took Name. It can not be empty. | ||
- Read the Tool Description and ensure your args and kwarg follow what each tool expects in types. e.g. (a=1, b=2) if it is keyword argument or (1, 2) if it is positional. | ||
- You will always end with 'finish' action to finish the task. The answer can be the final answer or failure message. | ||
- When the initial query is simple, use minimum steps to answer the query. | ||
{#Examples can be here#} | ||
{# Check if there are any examples #} | ||
{% if examples %} | ||
<EXAMPLES> | ||
{% for example in examples %} | ||
{{ example }} | ||
{% endfor %} | ||
</EXAMPLES> | ||
{% endif %} | ||
<</SYS>> | ||
----------------- | ||
{# History #} | ||
{% for history in step_history %} | ||
Step {{history.step}}: | ||
{ | ||
"thought": "{{history.thought}}", | ||
"action": "{{history.action}}", | ||
} | ||
"observation": "{{history.observation}}" | ||
{% endfor %} | ||
{% if input_str %} | ||
User query: | ||
{{ input_str }} | ||
{% endif %} | ||
""" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -31,7 +31,7 @@ Agents | |
components.agent | ||
|
||
Model Clients | ||
----------- | ||
----------------- | ||
.. toctree:: | ||
:maxdepth: 1 | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.