Skip to content

Commit 118e026

Browse files
authored
Update gradio-client.mdx
1 parent 28a9a29 commit 118e026

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

units/en/unit2/gradio-client.mdx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,10 @@ tools = mcp_client.get_tools()
3939
```
4040

4141
Now that we have the tools, we can create a simple agent that uses them to answer questions. We'll just use a simple `InferenceClientModel` and the default model from `smolagents` for now.
42+
It is important to pass your api_key to the InferenceClientModel. You can access the token from your huggingface account. [check here.](https://huggingface.co/docs/hub/en/security-tokens).
4243

4344
```python
44-
model = InferenceClientModel()
45+
model = InferenceClientModel(api_key = YOUR_API_TOKEN)
4546
agent = CodeAgent(tools=[*tools], model=model)
4647
```
4748

@@ -53,8 +54,7 @@ demo = gr.ChatInterface(
5354
type="messages",
5455
examples=["Prime factorization of 68"],
5556
title="Agent with MCP Tools",
56-
description="This is a simple agent that uses MCP tools to answer questions.",
57-
messages=[],
57+
description="This is a simple agent that uses MCP tools to answer questions."
5858
)
5959

6060
demo.launch()

0 commit comments

Comments
 (0)