|
58 | 58 | }, |
59 | 59 | { |
60 | 60 | "cell_type": "code", |
61 | | - "execution_count": null, |
| 61 | + "execution_count": 3, |
62 | 62 | "id": "4d315465", |
63 | 63 | "metadata": {}, |
64 | 64 | "outputs": [], |
|
107 | 107 | "# Direct invoke\n", |
108 | 108 | "html_text = tool.invoke(\n", |
109 | 109 | " {\n", |
110 | | - " \"url\": \"https://example.com\",\n", |
111 | | - " \"output_format\": \"text\",\n", |
| 110 | + " \"url\": \"https://langchain.com\",\n", |
| 111 | + " \"output_format\": \"markdown\",\n", |
112 | 112 | " \"render\": True,\n", |
113 | 113 | " }\n", |
114 | 114 | ")\n", |
115 | | - "print(html_text[:300], \"…\")\n", |
116 | | - "\n", |
117 | | - "# Invoke with a ToolCall dict (for agents)\n", |
118 | | - "tool_call = {\n", |
119 | | - " \"args\": {\"url\": \"https://example.com\", \"render\": True},\n", |
120 | | - " \"id\": \"1\",\n", |
121 | | - " \"name\": \"scraperapi\",\n", |
122 | | - " \"type\": \"tool_call\",\n", |
123 | | - "}\n", |
124 | | - "response = tool.invoke(tool_call)\n", |
125 | | - "print(type(response), len(response))" |
| 115 | + "print(html_text[:300], \"…\")" |
126 | 116 | ] |
127 | 117 | }, |
128 | 118 | { |
|
236 | 226 | "agent_executor = AgentExecutor(agent=agent, tools=tools, verbose=True)\n", |
237 | 227 | "response = agent_executor.invoke({\n", |
238 | 228 | " \"input\": \"can you browse hackernews and summarize the first website\"\n", |
239 | | - "})\n", |
240 | | - "print(response)" |
| 229 | + "})" |
241 | 230 | ] |
242 | 231 | }, |
243 | 232 | { |
|
262 | 251 | "main_language": "python", |
263 | 252 | "notebook_metadata_filter": "-all" |
264 | 253 | }, |
| 254 | + "kernelspec": { |
| 255 | + "display_name": "Python 3", |
| 256 | + "language": "python", |
| 257 | + "name": "python3" |
| 258 | + }, |
265 | 259 | "language_info": { |
266 | | - "name": "python" |
| 260 | + "codemirror_mode": { |
| 261 | + "name": "ipython", |
| 262 | + "version": 3 |
| 263 | + }, |
| 264 | + "file_extension": ".py", |
| 265 | + "mimetype": "text/x-python", |
| 266 | + "name": "python", |
| 267 | + "nbconvert_exporter": "python", |
| 268 | + "pygments_lexer": "ipython3", |
| 269 | + "version": "3.10.2" |
267 | 270 | } |
268 | 271 | }, |
269 | 272 | "nbformat": 4, |
|
0 commit comments