Google has put their AI online. It seems that this would be useful for
testing. It would also be useful in cases where we didn't know the
correct symbolic response.
This could easily be connected using either an external connection
similar to the Sage work or just making an external CURL function
call and parsing the JSON for the result.
If you visit ai.google.dev you can sign up to use their AI software.
Once you sign up for a developer's key you can send HTML requests
and receive JSON responses. It seems to know symbolic mathematics.
For example I tried:
curl \ -H 'Content-Type: application/json' \ -d '{ "prompt": { "text":
"Integrate sin(x)"} }' \
"https://generativelanguage.googleapis.com/v1beta3/models/text-bison-001:generateText?key=YOUR_API_KEY"
and got the following response
{
"candidates": [
{
"output": "dx -cos(x)+C",
"safetyRatings": [
{
"category": "HARM_CATEGORY_DEROGATORY",
"probability": "NEGLIGIBLE"
},
{
"category": "HARM_CATEGORY_TOXICITY",
"probability": "NEGLIGIBLE"
},
{
"category": "HARM_CATEGORY_VIOLENCE",
"probability": "NEGLIGIBLE"
},
{
"category": "HARM_CATEGORY_SEXUAL",
"probability": "NEGLIGIBLE"
},
{
"category": "HARM_CATEGORY_MEDICAL",
"probability": "NEGLIGIBLE"
},
{
"category": "HARM_CATEGORY_DANGEROUS",
"probability": "NEGLIGIBLE"
}
]
}
]
}
I even tried plots:
curl \
-H 'Content-Type: application/json' \
-d '{ "prompt": { "text": "plot sin(x) for x between 0 and pi"} }' \
"https://generativelanguage.googleapis.com/v1beta3/models/text-bison-001:generateText?key=YOUR_API_KEY"
> > > {
"candidates": [
{
"output": "```\nimport numpy as np\nimport matplotlib.pyplot as
plt\n\n# Define the range of x-values\nx = np.linspace(0, np.pi, 100)\n\n#
Compute the sin(x) values\ny = np.sin(x)\n\n# Plot the sin(x)
values\nplt.plot(x, y)\nplt.show()\n```\n\nOutput:\n\n",
"safetyRatings": [
{
"category": "HARM_CATEGORY_DEROGATORY",
"probability": "NEGLIGIBLE"
},
{
"category": "HARM_CATEGORY_TOXICITY",
"probability": "NEGLIGIBLE"
},
{
"category": "HARM_CATEGORY_VIOLENCE",
"probability": "NEGLIGIBLE"
},
{
"category": "HARM_CATEGORY_SEXUAL",
"probability": "NEGLIGIBLE"
},
{
"category": "HARM_CATEGORY_MEDICAL",
"probability": "NEGLIGIBLE"
},
{
"category": "HARM_CATEGORY_DANGEROUS",
"probability": "NEGLIGIBLE"
}
]
}
]
}
--
You received this message because you are subscribed to the Google Groups
"FriCAS - computer algebra system" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/fricas-devel/d273de18-6a6d-4421-a05e-78743ff8bd1dn%40googlegroups.com.