Spaces:
Running
Running
Usage instructions
Browse files- index.html +11 -10
index.html
CHANGED
|
@@ -11,19 +11,20 @@
|
|
| 11 |
<h1>Wolfram Alpha Tool for HuggingFace Agents</h1>
|
| 12 |
<p>Not sure how to set this manually (push_to_hub does not seem to work for tool classes) so:</p>
|
| 13 |
<p> Copy the contents of:<p>
|
|
|
|
| 14 |
https://huggingface.co/spaces/LecJackS/wolfram-alpha-query/blob/main/wolfram-alpha-tool
|
| 15 |
|
| 16 |
<h1>Usage:</h1>
|
| 17 |
<code>
|
| 18 |
-
CFG_appid
|
| 19 |
-
|
| 20 |
</code>
|
| 21 |
|
| 22 |
<h3>Test it:</h3>
|
| 23 |
<code>
|
| 24 |
-
query = "Integrate [ log(x)^2 + e^(x^2) dx ]"
|
| 25 |
-
wolframalpha_tool = WolframAlpha()
|
| 26 |
-
print(wolframalpha_tool(query))
|
| 27 |
</code>
|
| 28 |
|
| 29 |
<h3>Add tool to agent:</h3>
|
|
@@ -32,11 +33,11 @@ agent = HfAgent("https://api-inference.huggingface.co/models/bigcode/starcoder",
|
|
| 32 |
</code>
|
| 33 |
<h3>Ask the agent to solve some math:</h3>
|
| 34 |
<code>
|
| 35 |
-
res = agent.run("Solve the following equation: Area of circle of radius 2")
|
| 36 |
-
print(res)
|
| 37 |
-
|
| 38 |
-
res = agent.run("Integrate log(x)^2 + e^(x^2) dx")
|
| 39 |
-
print(res)
|
| 40 |
</code>
|
| 41 |
</div>
|
| 42 |
</body>
|
|
|
|
| 11 |
<h1>Wolfram Alpha Tool for HuggingFace Agents</h1>
|
| 12 |
<p>Not sure how to set this manually (push_to_hub does not seem to work for tool classes) so:</p>
|
| 13 |
<p> Copy the contents of:<p>
|
| 14 |
+
<a href="https://huggingface.co/spaces/LecJackS/wolfram-alpha-query/blob/main/wolfram-alpha-tool">https://huggingface.co/spaces/LecJackS/wolfram-alpha-query/blob/main/wolfram-alpha-tool</a>
|
| 15 |
https://huggingface.co/spaces/LecJackS/wolfram-alpha-query/blob/main/wolfram-alpha-tool
|
| 16 |
|
| 17 |
<h1>Usage:</h1>
|
| 18 |
<code>
|
| 19 |
+
CFG_appid = WOLFRAM_API_KEY<br>
|
| 20 |
+
<a href="https://products.wolframalpha.com/simple-api/documentation">https://products.wolframalpha.com/simple-api/documentation</a>
|
| 21 |
</code>
|
| 22 |
|
| 23 |
<h3>Test it:</h3>
|
| 24 |
<code>
|
| 25 |
+
query = "Integrate [ log(x)^2 + e^(x^2) dx ]"<br>
|
| 26 |
+
wolframalpha_tool = WolframAlpha()<br>
|
| 27 |
+
print(wolframalpha_tool(query))<br>
|
| 28 |
</code>
|
| 29 |
|
| 30 |
<h3>Add tool to agent:</h3>
|
|
|
|
| 33 |
</code>
|
| 34 |
<h3>Ask the agent to solve some math:</h3>
|
| 35 |
<code>
|
| 36 |
+
res = agent.run("Solve the following equation: Area of circle of radius 2")<br>
|
| 37 |
+
print(res)<br>
|
| 38 |
+
<br>
|
| 39 |
+
res = agent.run("Integrate log(x)^2 + e^(x^2) dx")<br>
|
| 40 |
+
print(res)<br>
|
| 41 |
</code>
|
| 42 |
</div>
|
| 43 |
</body>
|