Update How-to Guides (#417)

- reduce the number of API keys needed (Use simple tool)
- make everything "tool use" oriented rather than split across agent executor, function calling, tool use, etc.
- Reorg navbar and index
- Fixup some docstrings
- Add more links to ref docs
- Mix up models used
- Simplify a few examples
This commit is contained in:
William FH
2024-05-07 23:09:17 -07:00
committed by GitHub
parent f49e8dbc98
commit 991d35be08
31 changed files with 6734 additions and 1996 deletions
+36 -8
View File
@@ -20,16 +20,17 @@ _MANUAL = {
"state-model.ipynb",
"subgraph.ipynb",
"persistence_postgres.ipynb",
"force-calling-a-tool-first.ipynb",
"dynamic-returning-direct.ipynb",
"managing-agent-steps.ipynb",
"respond-in-format.ipynb",
"branching.ipynb",
"dynamically-returning-directly.ipynb",
"configuration.ipynb",
],
"tutorials": [
"introduction.ipynb",
"chat_agent_executor_with_function_calling/base.ipynb",
"chat_agent_executor_with_function_calling/high-level.ipynb",
"chat_agent_executor_with_function_calling/high-level-tools.ipynb",
"chat_agent_executor_with_function_calling/prebuilt-tool-node.ipynb",
"agent_executor/base.ipynb",
"agent_executor/high-level.ipynb",
"customer-support/customer-support.ipynb",
],
}
_MANUAL_INVERSE = {v: docs_dir / k for k, vs in _MANUAL.items() for v in vs}
@@ -37,7 +38,30 @@ _HOW_TOS = {"agent_executor", "chat_agent_executor_with_function_calling", "docs
_MAP = {
"persistence_postgres.ipynb": "tutorial",
}
_IGNORE = (".ipynb_checkpoints", ".venv", ".cache")
_HIDE = set(
str(examples_dir / f)
for f in [
"persistence_postgres.ipynb",
"agent_executor/base.ipynb",
"agent_executor/force-calling-a-tool-first.ipynb",
"agent_executor/high-level.ipynb",
"agent_executor/human-in-the-loop.ipynb",
"agent_executor/managing-agent-steps.ipynb",
"chat_agent_executor_with_function_calling/anthropic.ipynb",
"chat_agent_executor_with_function_calling/base.ipynb",
"chat_agent_executor_with_function_calling/dynamically-returning-directly.ipynb",
"chat_agent_executor_with_function_calling/force-calling-a-tool-first.ipynb",
"chat_agent_executor_with_function_calling/high-level-tools.ipynb",
"chat_agent_executor_with_function_calling/high-level.ipynb",
"chat_agent_executor_with_function_calling/human-in-the-loop.ipynb",
"chat_agent_executor_with_function_calling/managing-agent-steps.ipynb",
"chat_agent_executor_with_function_calling/prebuilt-tool-node.ipynb",
"chat_agent_executor_with_function_calling/respond-in-format.ipynb",
"chatbots/customer-support.ipynb",
"rag/langgraph_rag_agent_llama3_local.ipynb",
"rag/langgraph_self_rag_pinecone_movies.ipynb",
]
)
def clean_notebooks():
@@ -74,6 +98,9 @@ def copy_notebooks():
if file in _MAP:
dst_dir = os.path.join(dst_dir, _MAP[file])
src_path = os.path.join(root, file)
if src_path in _HIDE:
print("Hiding:", src_path)
continue
dst_path = os.path.join(
dst_dir, os.path.relpath(src_path, examples_dir)
)
@@ -83,10 +110,11 @@ def copy_notebooks():
dst_path = os.path.join(
overridden_dir, os.path.relpath(src_path, examples_dir)
)
print(f"Overriding {src_path} to {dst_path}")
print(f"Overriding: {src_path} to {dst_path}")
break
os.makedirs(os.path.dirname(dst_path), exist_ok=True)
print(f"Copying: {src_path} to {dst_path}")
shutil.copy(src_path, dst_path)
# Convert all ./img/* to ../img/*
if file.endswith(".ipynb"):