LecJackS commited on
Commit
4bc81ea
1 Parent(s): dea2464

First commit, usage instructions

Browse files
Files changed (1) hide show
  1. index.html +30 -6
index.html CHANGED
@@ -8,12 +8,36 @@
8
  </head>
9
  <body>
10
  <div class="card">
11
- <h1>Welcome to your static Space!</h1>
12
- <p>You can modify this app directly by editing <i>index.html</i> in the Files and versions tab.</p>
13
- <p>
14
- Also don't forget to check the
15
- <a href="https://huggingface.co/docs/hub/spaces" target="_blank">Spaces documentation</a>.
16
- </p>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
17
  </div>
18
  </body>
19
  </html>
 
8
  </head>
9
  <body>
10
  <div class="card">
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=<WOLFRAM API KEY>
19
+ # https://products.wolframalpha.com/simple-api/documentation
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>
30
+ <code>
31
+ agent = HfAgent("https://api-inference.huggingface.co/models/bigcode/starcoder", additional_tools=[wolframalpha_tool])
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>
43
  </html>