-
Notifications
You must be signed in to change notification settings - Fork 15.6k
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
community: set default output_token_limit
value for PowerBIToolkit
to fix validation error
#26308
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
dosubot
bot
added
size:XS
This PR changes 0-9 lines, ignoring generated files.
community
Related to langchain-community
labels
Sep 11, 2024
ccurme
approved these changes
Nov 4, 2024
dosubot
bot
added
the
lgtm
PR looks good. Use to confirm that a PR is ready for merging.
label
Nov 4, 2024
Wondering if it is preferable / possible to update
|
shjunn
pushed a commit
to shjunn/langchain
that referenced
this pull request
Nov 4, 2024
…` to fix validation error (langchain-ai#26308) ### Description: This PR sets a default value of `output_token_limit = 4000` for the `PowerBIToolkit` to fix the unintentionally validation error. ### Problem: When attempting to run a code snippet from [Langchain's PowerBI toolkit documentation](https://python.langchain.com/v0.1/docs/integrations/toolkits/powerbi/) to interact with a `PowerBIDataset`, the following error occurs: ``` pydantic.v1.error_wrappers.ValidationError: 1 validation error for QueryPowerBITool output_token_limit none is not an allowed value (type=type_error.none.not_allowed) ``` ### Root Cause: The issue arises because when creating a `QueryPowerBITool`, the `output_token_limit` parameter is unintentionally set to `None`, which is the current default for `PowerBIToolkit`. However, `QueryPowerBITool` expects a default value of `4000` for `output_token_limit`. This unintended override causes the error. https://github.com/langchain-ai/langchain/blob/17659ca2cdc418436edf2f8c7f50e800dbbf31ca/libs/community/langchain_community/agent_toolkits/powerbi/toolkit.py#L63 https://github.com/langchain-ai/langchain/blob/17659ca2cdc418436edf2f8c7f50e800dbbf31ca/libs/community/langchain_community/agent_toolkits/powerbi/toolkit.py#L72-L79 https://github.com/langchain-ai/langchain/blob/17659ca2cdc418436edf2f8c7f50e800dbbf31ca/libs/community/langchain_community/tools/powerbi/tool.py#L39 ### Solution: To resolve this, the default value of `output_token_limit` is now explicitly set to `4000` in `PowerBIToolkit` to prevent the accidental assignment of `None`. Co-authored-by: ccurme <[email protected]>
yanomaly
pushed a commit
to yanomaly/langchain
that referenced
this pull request
Nov 8, 2024
…` to fix validation error (langchain-ai#26308) ### Description: This PR sets a default value of `output_token_limit = 4000` for the `PowerBIToolkit` to fix the unintentionally validation error. ### Problem: When attempting to run a code snippet from [Langchain's PowerBI toolkit documentation](https://python.langchain.com/v0.1/docs/integrations/toolkits/powerbi/) to interact with a `PowerBIDataset`, the following error occurs: ``` pydantic.v1.error_wrappers.ValidationError: 1 validation error for QueryPowerBITool output_token_limit none is not an allowed value (type=type_error.none.not_allowed) ``` ### Root Cause: The issue arises because when creating a `QueryPowerBITool`, the `output_token_limit` parameter is unintentionally set to `None`, which is the current default for `PowerBIToolkit`. However, `QueryPowerBITool` expects a default value of `4000` for `output_token_limit`. This unintended override causes the error. https://github.com/langchain-ai/langchain/blob/17659ca2cdc418436edf2f8c7f50e800dbbf31ca/libs/community/langchain_community/agent_toolkits/powerbi/toolkit.py#L63 https://github.com/langchain-ai/langchain/blob/17659ca2cdc418436edf2f8c7f50e800dbbf31ca/libs/community/langchain_community/agent_toolkits/powerbi/toolkit.py#L72-L79 https://github.com/langchain-ai/langchain/blob/17659ca2cdc418436edf2f8c7f50e800dbbf31ca/libs/community/langchain_community/tools/powerbi/tool.py#L39 ### Solution: To resolve this, the default value of `output_token_limit` is now explicitly set to `4000` in `PowerBIToolkit` to prevent the accidental assignment of `None`. Co-authored-by: ccurme <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description:
This PR sets a default value of
output_token_limit = 4000
for thePowerBIToolkit
to fix the unintentionally validation error.Problem:
When attempting to run a code snippet from Langchain's PowerBI toolkit documentation to interact with a
PowerBIDataset
, the following error occurs:Root Cause:
The issue arises because when creating a
QueryPowerBITool
, theoutput_token_limit
parameter is unintentionally set toNone
, which is the current default forPowerBIToolkit
. However,QueryPowerBITool
expects a default value of4000
foroutput_token_limit
. This unintended override causes the error.langchain/libs/community/langchain_community/agent_toolkits/powerbi/toolkit.py
Line 63 in 17659ca
langchain/libs/community/langchain_community/agent_toolkits/powerbi/toolkit.py
Lines 72 to 79 in 17659ca
langchain/libs/community/langchain_community/tools/powerbi/tool.py
Line 39 in 17659ca
Solution:
To resolve this, the default value of
output_token_limit
is now explicitly set to4000
inPowerBIToolkit
to prevent the accidental assignment ofNone
.