Skip to content

Langchain passes prompt as a list instead of str in Retrieval Chain to Openai API #19872

@dvirmor

Description

@dvirmor

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.
  • The bug is not resolved by updating to the latest stable version of LangChain (or the specific integration package).

Example Code

https://js.langchain.com/docs/modules/chains/popular/vector_db_qa

Error Messaged and Stack Trace (if applicable)

No response

Description

Several platforms offer the OpenAI API as an alternative to their own API. Examples include TGI and vLLM. However, in these platforms, prompts must be provided as a single string rather than a list of strings. Unfortunately, when using the QA retrieval chain, I encounter an error because it requires a list of prompts.

Issues related to this:
vllm-project/vllm#186
vllm-project/vllm#323 (comment)

System Info

langchain 0.1.14
Windows

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugRelated to a bug, vulnerability, unexpected error with an existing feature

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions