Skip to content

AISdkClient2(第 39244 行):**没有** getLanguageModel() 方法 #1353

@Sophon-One

Description

@Sophon-One

Stagehand v3.0.5 的 AISdkClient Bug

问题描述

Error executing agent task: No LLM API key or LLM Client configured

原因

  • Stagehand 源码中有两个 AISdkClient 类:
    • AISdkClient(第 16183 行):有 getLanguageModel() 方法
    • AISdkClient2(第 39244 行):没有 getLanguageModel() 方法
  • 包导出的是 AISdkClient2AISdkClient: () => AISdkClient2
  • Agent 内部需要调用 llmClient.getLanguageModel() 但方法不存在

解决方案(临时 Workaround):

// 手动添加缺失的方法
if (!llmClient.getLanguageModel) {
  (llmClient as any).getLanguageModel = () => model;
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions