Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Wolfram alpha tool #578

Merged

Conversation

nickscamara
Copy link
Contributor

Issue linked with: #455

Added Wolfram Alpha as a tool.

@hwchase17 hwchase17 changed the base branch from master to harrison/wolfram-alpha January 11, 2023 03:06
@hwchase17 hwchase17 merged commit 33dace1 into langchain-ai:harrison/wolfram-alpha Jan 11, 2023
def run(self, query: str) -> str:
"""Run query through WolframAlpha and parse result."""
res = self.wolfram_client.query(query)
# Includes only text from the response
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@nickscamara can we return more from the Wolfram response (e.g. the units of the answer)? For example, if you run a query like "How big is the moon?" via LangChain's wrapper, you get back "1079.6", and then LangChain will return "The moon is 1079.6 miles in diameter.", which is incorrect - 1079.6 is actually the radius, not the diameter.

I'm assuming the Wolfram response included that, but it was just dropped by the wrapper?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for that! #584 should now include the assumption.

nickscamara added a commit to nickscamara/langchain that referenced this pull request Jan 11, 2023
nickscamara added a commit to nickscamara/langchain that referenced this pull request Jan 11, 2023
hwchase17 pushed a commit that referenced this pull request Jan 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants