SAP-samples / SAP-samples/codejam-code-based-agents

JavaScript track: exercise 07's OrchestrationClient constructor missing resourceGroup

未关闭 适合新手
#34 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

主要语言
Python
星标
54
派生
36
PR 合并指标
30 天内没有已合并 PR

描述

Summary

07-solve-the-crime.md instructs learners to write an OrchestrationClient constructor missing the resourceGroup argument:

typescript constructor(model: string = process.env.MODEL_NAME!) { this.orchestrationClient = new OrchestrationClient({ promptTemplating: { model: { name: model, params: { temperature: 0.7, max_tokens: 2000 } } }, }); this.graph = this.buildGraph(); } ​

Unlike every other OrchestrationClient in this track (groundingClient/webSearchClient in tools.ts, both of which correctly pass { resourceGroup: process.env.RESOURCE_GROUP } as the second constructor argument), this one omits it entirely. Same bug exists in project/JavaScript/solution/src/investigationWorkflow.ts.

Effect

Any tenant not using AI Core's default resource group (which the exercises themselves warn against — see 05-add-the-grounding-service.md: "DO NOT USE THE DEFAULT default RESOURCE GROUP!") gets:
Error: No deployment matched the given criteria: {"scenarioId":"orchestration"}. Make sure the deployment is successful... ​
thrown from both intelligenceResearcherNode (the report-synthesis call after the sonar-pro searches) and leadDetectiveNode, since both use this.orchestrationClient.

Suggested fix

​```diff
this.orchestrationClient = new OrchestrationClient({
promptTemplating: { model: { name: model, params: { temperature: 0.7, max_tokens: 2000 } } },

  • });
  • }, { resourceGroup: process.env.RESOURCE_GROUP });
    ​```
    in both exercises/JavaScript/07-solve-the-crime.md and `project/JavaScript/solution/src/investigationWorkflow.ts`.

Environment

Reproduced on a personal SAP AI Core tenant (not the shared CodeJam subaccount), JavaScript/TypeScript track, exercises 01–07 followed in order.

贡献指南

这个仓库没有索引到贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

调研方向

将 exercises/JavaScript/07-solve-the-crime.md 和 project/JavaScript/solution/src/investigationWorkflow.ts 中的 OrchestrationClient 构造函数与 track 的 tools.ts 中可正常工作的构造函数进行比较。确认两个构造函数都将 process.env.RESOURCE_GROUP 作为第二个参数传入,并确保 exercise 和 solution 展示相同的修正后行为。

由索引模型根据 Issue 内容生成。

评估

技术栈
typescript
领域
ai
Issue 类型
缺陷
难度
2/5
预计耗时
1-3 小时
活跃度
冷清
描述清晰度
描述清楚
新手友好度
84/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。