mirror of
https://github.com/langchain-ai/langgraph.git
synced 2026-09-13 21:27:52 +02:00
Merge branch 'main' into wfh/recurse
This commit is contained in:
@@ -511,6 +511,11 @@ It can often be tough to evaluation chat bots in multi-turn situations. One way
|
||||
|
||||
- [WebVoyager](https://github.com/langchain-ai/langgraph/blob/main/examples/web-navigation/web_voyager.ipynb): vision-enabled web browsing agent that uses [Set-of-marks](https://som-gpt4v.github.io/) prompting to navigate a web browser and execute tasks
|
||||
|
||||
### [Chain-of-Table](https://github.com/CYQIQ/MultiCoT)
|
||||
|
||||
[Chain of Table](https://arxiv.org/abs/2401.04398) is a framework that elicits SOTA performance when answering questions over tabular data. [This implementation](https://github.com/CYQIQ/MultiCoT) by Github user [CYQIQ](https://github.com/CYQIQ) uses LangGraph to control the flow.
|
||||
|
||||
|
||||
## Documentation
|
||||
|
||||
There are only a few new APIs to use.
|
||||
|
||||
@@ -29,7 +29,7 @@
|
||||
"\n",
|
||||
"Recent works, such as AlphaCodium, have shown that code generation can be [substantially improved by using a \"flow\" paradigm](https://x.com/karpathy/status/1748043513156272416?s=20).\n",
|
||||
"\n",
|
||||
"Rather than naive `prompt:answer` paradigm, a `flow` paradigm constructs an answer to a coding question iteratively.\n",
|
||||
"Rather than a naive `prompt:answer` paradigm, a `flow` paradigm constructs an answer to a coding question iteratively.\n",
|
||||
"\n",
|
||||
"[AlphaCodium](https://github.com/Codium-ai/AlphaCodium) iteravely tests and improves an answer on public and AI-generated tests for a particular question. \n",
|
||||
"\n",
|
||||
@@ -39,7 +39,7 @@
|
||||
"\n",
|
||||
"## LangGraph self-corrective code assistant\n",
|
||||
"\n",
|
||||
"We wanted to test these the general idea of iterative code generation in LangGraph, making a few simplifications relative to the AlphaCodium work:\n",
|
||||
"We wanted to test the general idea of iterative code generation in LangGraph, making a few simplifications relative to the AlphaCodium work:\n",
|
||||
"\n",
|
||||
"1. We start with a set of documentation specified by a user\n",
|
||||
"2. We use a long context LLM to ingest it, and answer a question based upon it \n",
|
||||
|
||||
@@ -267,7 +267,7 @@
|
||||
"\n",
|
||||
" else:\n",
|
||||
" print(\"---DECISION: DOCS NOT RELEVANT---\")\n",
|
||||
" print(score.binary_score)\n",
|
||||
" print(grade)\n",
|
||||
" return \"no\"\n",
|
||||
"\n",
|
||||
"\n",
|
||||
@@ -338,7 +338,7 @@
|
||||
" messages = state[\"messages\"]\n",
|
||||
" question = messages[0].content\n",
|
||||
"\n",
|
||||
" msg = HumanMessage(\n",
|
||||
" msg = [HumanMessage(\n",
|
||||
" content=f\"\"\" \\n \n",
|
||||
" Look at the input and try to reason about the underlying semantic intent / meaning. \\n \n",
|
||||
" Here is the initial question:\n",
|
||||
@@ -346,7 +346,7 @@
|
||||
" {question} \n",
|
||||
" \\n ------- \\n\n",
|
||||
" Formulate an improved question: \"\"\",\n",
|
||||
" )\n",
|
||||
" )]\n",
|
||||
"\n",
|
||||
" # Grader\n",
|
||||
" model = ChatOpenAI(temperature=0, model=\"gpt-4-0125-preview\", streaming=True)\n",
|
||||
|
||||
@@ -342,6 +342,7 @@
|
||||
" _results = state[\"results\"] or {}\n",
|
||||
" for k, v in _results.items():\n",
|
||||
" tool_input = tool_input.replace(k, v)\n",
|
||||
" step_name = step_name.replace(k, v)\n",
|
||||
" plan += f\"Plan: {_plan}\\n{step_name} = {tool}[{tool_input}]\"\n",
|
||||
" prompt = solve_prompt.format(plan=plan, task=state[\"task\"])\n",
|
||||
" result = model.invoke(prompt)\n",
|
||||
|
||||
Reference in New Issue
Block a user