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

Invoking configurable_fields method on RunnableConfigurableAlternatives instance throws prefix_keys field required error #17915

Closed
4 tasks done
Avinash-Raj opened this issue Feb 22, 2024 · 0 comments · Fixed by #18139
Labels
🤖:bug Related to a bug, vulnerability, unexpected error with an existing feature 🔌: openai Primarily related to OpenAI integrations

Comments

@Avinash-Raj
Copy link
Contributor

Checked other resources

  • I added a very descriptive title to this issue.
  • I searched the LangChain documentation with the integrated search.
  • I used the GitHub search to find a similar question and didn't find it.
  • I am sure that this is a bug in LangChain rather than my code.

Example Code

from langchain_openai import OpenAI

lm_runnable = (
    OpenAI(temperature=0, openai_api_key="nothing")
    .configurable_alternatives(
        ConfigurableField(id="llm"),
        default_key="openai",
        prefix_keys=False)
    .configurable_fields(
        temperature=ConfigurableField(
            id="llm_temperature",
            name="LLM Temperature",
            description="The temperature of the LLM",
        )
    )
 )  

Error Message and Stack Trace (if applicable)

pydantic.v1.error_wrappers.ValidationError: 1 validation error for RunnableConfigurableAlternatives
prefix_keys
  field required (type=value_error.missing)

Description

I'm trying to add configure_fields to the existing configure_alternatives instance but I got the below exception.

System Info

langchain==0.1.8
langchain-community==0.0.21
langchain-core==0.1.25
langchain-openai==0.0.6
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🤖:bug Related to a bug, vulnerability, unexpected error with an existing feature 🔌: openai Primarily related to OpenAI integrations
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant