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

JavaScript track: exercise 07's OrchestrationClient constructor missing resourceGroup

Abierto Apto para principiantes
#34 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Nadie ha tomado este issue todavía.

Lenguaje dominante
Python
Estrellas
54
Forks
36
Métricas de merge de PR
Sin PR fusionados en 30 d

Descripción

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.

Guía de contribución

No hay ninguna guía de contribución indexada para este repositorio

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Línea de trabajo

Compara el constructor de OrchestrationClient en exercises/JavaScript/07-solve-the-crime.md y project/JavaScript/solution/src/investigationWorkflow.ts con los constructores funcionales de tools.ts del track. Confirma que ambos constructores pasan process.env.RESOURCE_GROUP como segundo argumento y asegúrate de que el ejercicio y la solución muestren el mismo comportamiento corregido.

Escrito por el modelo de indexación a partir del texto del issue.

Evaluación

Stack tecnológico
typescript
Área
ai
Tipo de issue
Error
Dificultad
2/5
Tiempo estimado
1-3 horas
Estado de actividad
Tranquilo
Claridad
Bien especificado
Aptitud para principiantes
84/100

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.