You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

使用LangChain调用Vertex AI模型花园推理的解析问题求助

LangChain调用Vertex AI Model Garden部署的Mistral模型时输出仅显示单个字符的问题

我已在谷歌云成功将Mistral模型部署到端点,计划通过LangChain的VertexAIModelGarden类实现推理,但遇到输出解析异常:端点返回结果仅显示单个字符。

我在LangChain的GitHub仓库中找到过提及该问题的PR,同时发现第三方仓库提供了临时修复方案,试用后可正常运行,但有两个疑问:

  • 是否有其他用户遇到过相同问题?
  • 该临时修复是否会被纳入LangChain官方版本?

另外,这个临时修复目前暂不支持stream方法,只能使用invoke方法。

相关代码如下:

def build_chain(self, temperature=0.1, max_tokens=100000):
    PROMPT = PromptTemplate.from_template(self.prompt)

    llm = VertexAIModelGardenVllm(project=self.projectid, 
                                  endpoint_id=self.endpid, location=self.region)
    self.chain = (
        {"doc": itemgetter("resume"), "question": itemgetter("job_description")}
        | PROMPT 
        | llm
        | StrOutputParser()
    )

内容的提问来源于stack exchange,提问作者Davide Luise

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.06.30 03:34:54