agentic-api 2.0.31 → 2.0.314
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/src/agents/agents.example.js +21 -22
- package/dist/src/agents/authentication.js +1 -2
- package/dist/src/agents/prompts.d.ts +5 -4
- package/dist/src/agents/prompts.js +42 -87
- package/dist/src/agents/reducer.core.d.ts +24 -2
- package/dist/src/agents/reducer.core.js +125 -35
- package/dist/src/agents/reducer.loaders.d.ts +55 -1
- package/dist/src/agents/reducer.loaders.js +114 -1
- package/dist/src/agents/reducer.types.d.ts +45 -2
- package/dist/src/agents/semantic.js +1 -2
- package/dist/src/agents/simulator.d.ts +4 -0
- package/dist/src/agents/simulator.executor.d.ts +5 -1
- package/dist/src/agents/simulator.executor.js +41 -9
- package/dist/src/agents/simulator.js +86 -28
- package/dist/src/agents/simulator.prompts.d.ts +3 -2
- package/dist/src/agents/simulator.prompts.js +52 -78
- package/dist/src/agents/simulator.types.d.ts +20 -5
- package/dist/src/agents/simulator.utils.d.ts +7 -2
- package/dist/src/agents/simulator.utils.js +33 -11
- package/dist/src/agents/system.js +1 -2
- package/dist/src/execute.d.ts +17 -3
- package/dist/src/execute.js +156 -158
- package/dist/src/index.d.ts +1 -1
- package/dist/src/index.js +1 -1
- package/dist/src/{princing.openai.d.ts → pricing.llm.d.ts} +6 -0
- package/dist/src/pricing.llm.js +234 -0
- package/dist/src/prompts.d.ts +13 -4
- package/dist/src/prompts.js +221 -114
- package/dist/src/rag/embeddings.d.ts +36 -18
- package/dist/src/rag/embeddings.js +125 -128
- package/dist/src/rag/index.d.ts +5 -5
- package/dist/src/rag/index.js +14 -17
- package/dist/src/rag/parser.d.ts +2 -1
- package/dist/src/rag/parser.js +11 -14
- package/dist/src/rag/rag.examples.d.ts +27 -0
- package/dist/src/rag/rag.examples.js +151 -0
- package/dist/src/rag/rag.manager.d.ts +383 -0
- package/dist/src/rag/rag.manager.js +1378 -0
- package/dist/src/rag/types.d.ts +128 -12
- package/dist/src/rag/types.js +100 -1
- package/dist/src/rag/usecase.d.ts +37 -0
- package/dist/src/rag/usecase.js +96 -7
- package/dist/src/rules/git/git.e2e.helper.js +1 -0
- package/dist/src/rules/git/git.health.d.ts +57 -0
- package/dist/src/rules/git/git.health.js +281 -1
- package/dist/src/rules/git/index.d.ts +2 -2
- package/dist/src/rules/git/index.js +12 -1
- package/dist/src/rules/git/repo.d.ts +117 -0
- package/dist/src/rules/git/repo.js +536 -0
- package/dist/src/rules/git/repo.tools.d.ts +22 -1
- package/dist/src/rules/git/repo.tools.js +50 -1
- package/dist/src/rules/types.d.ts +16 -14
- package/dist/src/rules/utils.matter.d.ts +0 -4
- package/dist/src/rules/utils.matter.js +26 -7
- package/dist/src/scrapper.d.ts +15 -22
- package/dist/src/scrapper.js +57 -110
- package/dist/src/stategraph/index.d.ts +1 -1
- package/dist/src/stategraph/stategraph.d.ts +31 -2
- package/dist/src/stategraph/stategraph.js +93 -6
- package/dist/src/stategraph/stategraph.storage.js +4 -0
- package/dist/src/stategraph/types.d.ts +22 -0
- package/dist/src/types.d.ts +4 -2
- package/dist/src/types.js +1 -1
- package/dist/src/usecase.d.ts +11 -2
- package/dist/src/usecase.js +27 -35
- package/dist/src/utils.d.ts +32 -18
- package/dist/src/utils.js +60 -126
- package/package.json +7 -2
- package/dist/src/agents/digestor.test.d.ts +0 -1
- package/dist/src/agents/digestor.test.js +0 -45
- package/dist/src/agents/reducer.example.d.ts +0 -28
- package/dist/src/agents/reducer.example.js +0 -118
- package/dist/src/agents/reducer.process.d.ts +0 -16
- package/dist/src/agents/reducer.process.js +0 -143
- package/dist/src/agents/reducer.tools.d.ts +0 -29
- package/dist/src/agents/reducer.tools.js +0 -157
- package/dist/src/agents/simpleExample.d.ts +0 -3
- package/dist/src/agents/simpleExample.js +0 -38
- package/dist/src/agents/system-review.d.ts +0 -5
- package/dist/src/agents/system-review.js +0 -181
- package/dist/src/agents/systemReview.d.ts +0 -4
- package/dist/src/agents/systemReview.js +0 -22
- package/dist/src/princing.openai.js +0 -54
- package/dist/src/rag/tools.d.ts +0 -76
- package/dist/src/rag/tools.js +0 -196
- package/dist/src/rules/user.mapper.d.ts +0 -61
- package/dist/src/rules/user.mapper.js +0 -160
- package/dist/src/rules/utils/slug.d.ts +0 -22
- package/dist/src/rules/utils/slug.js +0 -35
|
@@ -6,71 +6,57 @@ exports.buildSimulatorQuery = exports.PERSONA_ENERVE = exports.PERSONA_PRESSE =
|
|
|
6
6
|
* COPIÉ et ADAPTÉ depuis agentInstructionModules.ClientSimulator
|
|
7
7
|
*/
|
|
8
8
|
exports.GENERIC_SIMULATOR_PROMPT = `
|
|
9
|
-
|
|
10
|
-
Tu
|
|
11
|
-
|
|
12
|
-
|
|
9
|
+
# TON RÔLE
|
|
10
|
+
Tu dois vérifier le comportement d'un AGENT CONVERSATIONNEL externe (The Guardian).
|
|
11
|
+
TU AS DEUX PERSONNALITÉS SIMULTANÉES: LE SIMULATEUR D'UN UTILISATEUR HUMAIN ET L'OBSERVATEUR DE LA CONVERSATION.
|
|
12
|
+
Chacune de tes réponses est une question posée à l'agent testé.
|
|
13
|
+
Comporte-toi naturellement selon la personnalité spécifiée plus bas.
|
|
13
14
|
|
|
14
|
-
|
|
15
|
+
## PERSONNALITÉ 1 - LE SIMULATEUR DU CLIENT (visible par l'agent )
|
|
16
|
+
Tu es le simulateur d'un utilisateur normal qui pose des questions à un agent.
|
|
17
|
+
Dans ce contexte, chacune de tes réponses est une question pour l'agent externe, et chacune de ses réponses est la prochaine question pour toi.
|
|
18
|
+
- Tu parles UNIQUEMENT en texte naturel non répétitif.
|
|
19
|
+
- Tu ne connais RIEN sur le fonctionnement technique de l'agent
|
|
20
|
+
- Tu ne mentionnes JAMAIS: "Objectifs", "Conditions", "Validation", "Transfert", "Outil", "Simulation"
|
|
21
|
+
- Tu te comportes selon la **Personnalité** fournie
|
|
22
|
+
Tu reçois les conditions initiales suivantes qui décrivent l'objectif de la simulation:
|
|
23
|
+
- **Personnalité**: caractère du CLIENT
|
|
24
|
+
- **Question**: la première question à poser à l'agent externe (sans interprétation, juste la question brute).
|
|
15
25
|
|
|
16
|
-
## SURVEILLANCE PERMANENTE À CHAQUE MESSAGE
|
|
17
|
-
- **CHAQUE MESSAGE** de l'agent testé doit être inspecté IMMÉDIATEMENT
|
|
18
|
-
- **DÈS qu'un candidat à **l'erreur fatale** apparaît → LE GARDER EN MEMOIRE JUSQU'AU "follow_up" OU "cloture" de la discussion.
|
|
19
|
-
- **DÈS que la discussion est dans l'état "follow_up" OU "cloture" SI l'erreur fatale en mémoire N'A PAS ÉTÉ CORRIGÉE, TU DOIS arrêter la simulation avec [SIMULATION_COMPLETE] {"success": false, "error": "Erreur fatale détectée: [détail précis]"}
|
|
20
|
-
- **Format obligatoire d'arrêt** : [SIMULATION_COMPLETE] avec success:false
|
|
21
|
-
- **Pas d'exception** : même si l'agent atteint les objectifs, une erreur fatale = ÉCHEC
|
|
22
|
-
- **DÈS qu'une erreur fatale apparaît** → ARRÊT IMMÉDIAT DE LA SIMULATION
|
|
23
26
|
|
|
24
|
-
##
|
|
25
|
-
|
|
26
|
-
- **
|
|
27
|
+
## PERSONNALITÉ 2 - L'OBSERVATEUR (secret, invisible)
|
|
28
|
+
En parallèle, tu observes secrètement si l'agent répond correctement.
|
|
29
|
+
- Tu notes mentalement si les **Objectifs** sont atteints ou partiellement atteints (incrémentale).
|
|
30
|
+
- Tu ne RÉVÈLES JAMAIS les observations dans tes messages.
|
|
31
|
+
- Quand les Objectifs sont atteints → tu produis \`[DONE] {JSON}\`
|
|
27
32
|
|
|
28
|
-
## PROCESSUS D'INSPECTION OBLIGATOIRE
|
|
29
|
-
À CHAQUE message de l'agent, tu DOIS :
|
|
30
33
|
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
34
|
+
Tu reçois les conditions initiales suivantes qui décrivent l'objectif de l'observation':
|
|
35
|
+
- **Objectifs**: ce que l'OBSERVATEUR doit vérifier de la discussion avec l'agent (Attention c'est interne)
|
|
36
|
+
⚠️ jamais mentionné cette analyse interne, mais elle guide le comportement de la "PERSONNALITÉ 1" pour atteindre les objectifs.
|
|
37
|
+
- **Format JSON**: structure du rapport de l'OBSERVATEUR
|
|
35
38
|
|
|
36
|
-
### ÉTAPE 2 : COMPORTEMENT UTILISATEUR (PRIORITÉ 2)
|
|
37
|
-
→ Si aucune erreur fatale : continuer la conversation selon persona + objectifs
|
|
38
|
-
→ Si conditions de fin atteintes : [SIMULATION_COMPLETE] avec rapport selon format
|
|
39
39
|
|
|
40
|
-
#
|
|
41
|
-
1.
|
|
42
|
-
2.
|
|
43
|
-
3.
|
|
44
|
-
4.
|
|
45
|
-
5.
|
|
40
|
+
# FLUX DE CONVERSATION
|
|
41
|
+
1. Reçois l'INPUT avec ta **Question** initiale
|
|
42
|
+
2. Pose cette question à l'agent (PERSONNALITÉ CLIENT)
|
|
43
|
+
3. L'agent répond
|
|
44
|
+
4. Observe si les **Objectifs** sont atteints (PERSONNALITÉ OBSERVATEUR)
|
|
45
|
+
5. Choisis ta sortie:
|
|
46
|
+
- Objectifs partiellement atteints → continue la conversation pour atteindre les objectifs complets.
|
|
47
|
+
- Objectifs atteints → \`[DONE] {"success": true}\`
|
|
48
|
+
- Comportement interdit → \`[DONE] {"success": false, "error": "..."}\` explique la raison de l'échec.
|
|
46
49
|
|
|
47
|
-
#
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
- **Confirmer simplement** : "Oui", "D'accord", "Très bien", "Entendu"
|
|
51
|
-
- **Pas de récapitulatifs** : Un utilisateur ne résume pas, il répond à la question posée
|
|
52
|
-
- **Personnalité authentique** : adopter la persona définie
|
|
53
|
-
- **Pas de méta** : jamais mentionner "test", "simulation", "objectifs", "évaluation"
|
|
50
|
+
# QUAND PRODUIRE [DONE]
|
|
51
|
+
L'OBSERVATEUR décide de terminer, mais le CLIENT ne le sait pas.
|
|
52
|
+
Le CLIENT continue à parler naturellement jusqu'à ce que l'OBSERVATEUR émette [DONE].
|
|
54
53
|
|
|
55
|
-
# FORMAT INPUT
|
|
56
|
-
|
|
54
|
+
# FORMAT INPUT
|
|
55
|
+
- **Personnalité**: caractère du CLIENT
|
|
56
|
+
- **Question**: ce que le CLIENT demande initialement
|
|
57
|
+
- **Objectifs**: ce que l'OBSERVATEUR doit vérifier (PRIVÉ, jamais mentionné par le CLIENT)
|
|
58
|
+
- **Format JSON**: format du rapport de l'OBSERVATEUR
|
|
57
59
|
|
|
58
|
-
## PROCESSUS DE LECTURE OBLIGATOIRE :
|
|
59
|
-
1. **LIRE D'ABORD** les erreurs fatales (si présentes) et les mémoriser
|
|
60
|
-
2. **ADOPTER** la personnalité indiquée
|
|
61
|
-
3. **VÉRIFIER** les objectifs tout en surveillant activement les erreurs
|
|
62
|
-
4. **TERMINER** selon les conditions OU dès qu'une erreur fatale apparaît
|
|
63
|
-
|
|
64
|
-
# GUIDE POUR VARIABLES DE TEST
|
|
65
|
-
- **testStart** : Première phrase/question du client pour commencer la simulation
|
|
66
|
-
- **testGoals** : Objectifs que l'agent doit atteindre (ce qui constitue un succès)
|
|
67
|
-
- **testEnd** : Conditions spécifiques qui marquent la fin réussie de la simulation
|
|
68
|
-
- **testPersona** : Personnalité à adopter (patient, pressé, énervé, etc.)
|
|
69
|
-
- **testError** : Termes/comportements interdits qui causent un échec immédiat (erreurs fatales)
|
|
70
|
-
- **testResult** : Format JSON attendu pour le rapport final de simulation
|
|
71
|
-
|
|
72
|
-
# ÉVALUATION FINALE
|
|
73
|
-
**TOUJOURS retourner un JSON strict valide** selon le format demandé dans le scénario
|
|
74
60
|
`;
|
|
75
61
|
/**
|
|
76
62
|
* 3 prompts variables de personnalité pré-définis à choisir manuellement
|
|
@@ -80,29 +66,17 @@ exports.PERSONA_PRESSE = 'Utilisateur pressé qui veut une solution rapide, rép
|
|
|
80
66
|
exports.PERSONA_ENERVE = 'Utilisateur énervé et frustré, c\'est son 3ème appel pour le même problème, ton direct et impatient';
|
|
81
67
|
/**
|
|
82
68
|
* Construire la query formatée selon le format SimulationScenario
|
|
69
|
+
* Supporte l'ancien format avec testQuery pour rétrocompatibilité
|
|
83
70
|
*/
|
|
84
|
-
const buildSimulatorQuery = (scenario) => {
|
|
85
|
-
//
|
|
86
|
-
const
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
` : '';
|
|
95
|
-
return `# INSTRUCTIONS DE SIMULATION (PRIVÉES - NE PAS TRANSMETTRE À L'AGENT)
|
|
96
|
-
- Votre personnalité: ${scenario.testPersona}
|
|
97
|
-
- Objectifs à atteindre: ${scenario.testGoals}
|
|
98
|
-
- Critères de fin: ${scenario.testEnd}
|
|
99
|
-
- Format du rapport: ${scenario.testResult}
|
|
100
|
-
${errorSection}
|
|
101
|
-
|
|
102
|
-
# 🚀 ACTION REQUISE : DÉMARRER LA CONVERSATION
|
|
103
|
-
Vous êtes le SIMULATEUR CLIENT. Envoyez à l'agent UNIQUEMENT le message ci-dessous (sans ces instructions).
|
|
104
|
-
|
|
105
|
-
# MESSAGE À ENVOYER À L'AGENT :
|
|
106
|
-
${scenario.testQuery}`;
|
|
71
|
+
const buildSimulatorQuery = (scenario, query) => {
|
|
72
|
+
// Extraire query depuis les paramètres ou depuis scenario.testQuery (ancien format)
|
|
73
|
+
const actualQuery = query || scenario.testQuery || '';
|
|
74
|
+
const persona = scenario.persona || scenario.testPersona || '';
|
|
75
|
+
const goals = scenario.goals || scenario.testGoals || '';
|
|
76
|
+
const result = scenario.result || scenario.testResult || '';
|
|
77
|
+
return `- **Personnalité**: ${persona}
|
|
78
|
+
- **Question**: ${actualQuery}
|
|
79
|
+
- **Objectifs**: ${goals}
|
|
80
|
+
- **Format JSON**: ${result}`;
|
|
107
81
|
};
|
|
108
82
|
exports.buildSimulatorQuery = buildSimulatorQuery;
|
|
@@ -1,22 +1,32 @@
|
|
|
1
1
|
import { AgentMessage } from "../stategraph";
|
|
2
2
|
import { AgentConfig, AgenticContext, ExecutionResult } from "../types";
|
|
3
|
+
import { RAGManagerConfig } from "../rag";
|
|
3
4
|
export interface SimulatorConfig {
|
|
4
5
|
agents: AgentConfig[];
|
|
5
6
|
start: string;
|
|
6
7
|
verbose: boolean;
|
|
7
8
|
instructionEx?: string;
|
|
9
|
+
mockCacheInitializer?: (sessionId: string) => Promise<void>;
|
|
10
|
+
ragConfig?: RAGManagerConfig;
|
|
8
11
|
}
|
|
9
12
|
export interface SimulationScenario {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
13
|
+
goals?: string;
|
|
14
|
+
persona?: string;
|
|
15
|
+
result?: string;
|
|
16
|
+
testGoals?: string;
|
|
17
|
+
testEnd?: string;
|
|
15
18
|
testError?: string;
|
|
19
|
+
testPersona?: string;
|
|
20
|
+
testQuery?: string;
|
|
21
|
+
testResult?: string;
|
|
16
22
|
}
|
|
17
23
|
export interface SimulationOptions {
|
|
18
24
|
scenario: SimulationScenario;
|
|
25
|
+
query?: string;
|
|
19
26
|
maxExchanges: number;
|
|
27
|
+
expectedTool?: Record<string, {
|
|
28
|
+
equal: number;
|
|
29
|
+
}>;
|
|
20
30
|
onMessage?: (message: AgentMessage) => void;
|
|
21
31
|
}
|
|
22
32
|
export interface SimulationResult {
|
|
@@ -25,6 +35,11 @@ export interface SimulationResult {
|
|
|
25
35
|
error: string;
|
|
26
36
|
execution: ExecutionResult;
|
|
27
37
|
exchangeCount: number;
|
|
38
|
+
messages: AgentMessage[];
|
|
39
|
+
toolValidation?: {
|
|
40
|
+
passed: boolean;
|
|
41
|
+
errors: string[];
|
|
42
|
+
};
|
|
28
43
|
}
|
|
29
44
|
export interface ExecutionContext {
|
|
30
45
|
agentContext: AgenticContext;
|
|
@@ -9,12 +9,17 @@ export declare function loadScenario(ticketPath: string): {
|
|
|
9
9
|
};
|
|
10
10
|
/**
|
|
11
11
|
* Construire SimulationScenario à partir d'un ticket PRSolver (rétrocompatibilité)
|
|
12
|
-
* Permet de surcharger tous les champs avec custom
|
|
12
|
+
* Permet de surcharger tous les champs avec custom
|
|
13
|
+
* Note: Cette fonction retourne un scenario SANS query - il faut la passer séparément à executeSimulation
|
|
13
14
|
*/
|
|
14
15
|
export declare function buildScenarioFromTicket(ticketPath: string, clientType: 'locataire' | 'proprietaire', persona?: string, // PERSONA_PATIENT | PERSONA_PRESSE | PERSONA_ENERVE
|
|
15
|
-
custom?: Partial<SimulationScenario>):
|
|
16
|
+
custom?: Partial<SimulationScenario>): {
|
|
17
|
+
scenario: SimulationScenario;
|
|
18
|
+
query: string;
|
|
19
|
+
};
|
|
16
20
|
/**
|
|
17
21
|
* Construire SimulationScenario générique directement
|
|
22
|
+
* Supporte l'ancien format (testGoals, testEnd, etc.) pour rétrocompatibilité
|
|
18
23
|
*/
|
|
19
24
|
export declare function buildGenericScenario(scenario: SimulationScenario): SimulationScenario;
|
|
20
25
|
export { PERSONA_PATIENT, PERSONA_PRESSE, PERSONA_ENERVE };
|
|
@@ -53,7 +53,8 @@ function loadScenario(ticketPath) {
|
|
|
53
53
|
}
|
|
54
54
|
/**
|
|
55
55
|
* Construire SimulationScenario à partir d'un ticket PRSolver (rétrocompatibilité)
|
|
56
|
-
* Permet de surcharger tous les champs avec custom
|
|
56
|
+
* Permet de surcharger tous les champs avec custom
|
|
57
|
+
* Note: Cette fonction retourne un scenario SANS query - il faut la passer séparément à executeSimulation
|
|
57
58
|
*/
|
|
58
59
|
function buildScenarioFromTicket(ticketPath, clientType, persona = simulator_prompts_1.PERSONA_PATIENT, // PERSONA_PATIENT | PERSONA_PRESSE | PERSONA_ENERVE
|
|
59
60
|
custom // Surcharge optionnelle de tous les champs
|
|
@@ -61,27 +62,48 @@ custom // Surcharge optionnelle de tous les champs
|
|
|
61
62
|
const { ticketMarkdown, ticketId } = loadScenario(ticketPath);
|
|
62
63
|
// Scenario par défaut complet
|
|
63
64
|
const defaultScenario = {
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
65
|
+
goals: `Valider les Objectifs de PRSolver pour ticket ${ticketId}. Agent termine avec salutations (état 5_cloture)`,
|
|
66
|
+
persona: persona,
|
|
67
|
+
result: 'done:boolean, error:string, description:string'
|
|
68
|
+
};
|
|
69
|
+
const query = `Je suis le client (demandeur '${clientType}') du ticket en ANNEXE. Démarre la conversation exactement comme décrit dans l'ANNEXE.
|
|
68
70
|
## ANNEXE - Ticket ${ticketId}
|
|
69
71
|
\`\`\`
|
|
70
72
|
${ticketMarkdown}
|
|
71
73
|
\`\`\`
|
|
72
|
-
|
|
73
|
-
testResult: 'done:boolean, error:string, description:string'
|
|
74
|
-
};
|
|
74
|
+
`;
|
|
75
75
|
// Merger avec custom
|
|
76
|
-
return {
|
|
76
|
+
return {
|
|
77
|
+
scenario: { ...defaultScenario, ...custom },
|
|
78
|
+
query
|
|
79
|
+
};
|
|
77
80
|
}
|
|
78
81
|
/**
|
|
79
82
|
* Construire SimulationScenario générique directement
|
|
83
|
+
* Supporte l'ancien format (testGoals, testEnd, etc.) pour rétrocompatibilité
|
|
80
84
|
*/
|
|
81
85
|
function buildGenericScenario(scenario) {
|
|
86
|
+
// Gérer la rétrocompatibilité avec l'ancien format
|
|
87
|
+
if (scenario.testGoals || scenario.testEnd || scenario.testError) {
|
|
88
|
+
// Ancien format détecté - conversion vers le nouveau format
|
|
89
|
+
let goals = scenario.testGoals || '';
|
|
90
|
+
if (scenario.testEnd) {
|
|
91
|
+
goals += `\nCONDITION DE FIN: ${scenario.testEnd}`;
|
|
92
|
+
}
|
|
93
|
+
if (scenario.testError) {
|
|
94
|
+
goals += `\nERREUR FATALE: ${scenario.testError}`;
|
|
95
|
+
}
|
|
96
|
+
return {
|
|
97
|
+
goals: goals.trim(),
|
|
98
|
+
persona: scenario.testPersona || scenario.persona || '',
|
|
99
|
+
result: scenario.testResult || scenario.result || '{"success": boolean, "error": string, "description": string}',
|
|
100
|
+
// Garder testQuery pour extraction ultérieure
|
|
101
|
+
testQuery: scenario.testQuery
|
|
102
|
+
};
|
|
103
|
+
}
|
|
104
|
+
// Nouveau format - juste ajouter un result par défaut si manquant
|
|
82
105
|
return {
|
|
83
106
|
...scenario,
|
|
84
|
-
|
|
85
|
-
testResult: scenario.testResult || 'done:boolean, error:string, description:string'
|
|
107
|
+
result: scenario.result || '{"success": boolean, "error": string, "description": string}'
|
|
86
108
|
};
|
|
87
109
|
}
|
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.system = void 0;
|
|
4
|
-
const execute_1 = require("../execute");
|
|
5
4
|
const utils_1 = require("../utils");
|
|
6
5
|
const prompts_1 = require("./prompts");
|
|
7
6
|
exports.system = {
|
|
8
7
|
name: "systemReview",
|
|
9
8
|
human: true,
|
|
10
|
-
model:
|
|
9
|
+
model: "MEDIUM",
|
|
11
10
|
publicDescription: "Agent chargé d'analyser le contenu d'un prompt système et de présenter ses remarques",
|
|
12
11
|
instructions: prompts_1.systemReviewPrompt,
|
|
13
12
|
tools: [],
|
package/dist/src/execute.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { AgentConfig, AgenticContext, AgentModel, ExecuteAgentResult, Feedback, ExecutionResult } from "./types";
|
|
2
2
|
import { Writable } from "stream";
|
|
3
3
|
import { AgentStateGraph } from "./stategraph";
|
|
4
|
+
export declare const DummyWritable: any;
|
|
4
5
|
export declare function modelConfig(model: string, custom?: any): AgentModel;
|
|
5
6
|
export declare function sendFeedback(params: Feedback): void;
|
|
6
7
|
export interface ReadCompletionsStreamOptions {
|
|
@@ -8,7 +9,7 @@ export interface ReadCompletionsStreamOptions {
|
|
|
8
9
|
discussion: any;
|
|
9
10
|
agentConfig: AgentConfig;
|
|
10
11
|
agents: AgentConfig[];
|
|
11
|
-
|
|
12
|
+
discussionRootAgent: string;
|
|
12
13
|
stdout: Writable;
|
|
13
14
|
session: AgenticContext;
|
|
14
15
|
final: any;
|
|
@@ -19,19 +20,22 @@ export declare function readCompletionsStream(params: ReadCompletionsStreamOptio
|
|
|
19
20
|
/**
|
|
20
21
|
* Parameters for executing an agent set
|
|
21
22
|
* @interface ExecuteAgentSetParams
|
|
22
|
-
* @property {OpenAI} openai - OpenAI client instance
|
|
23
23
|
* @property {string} query - User query to process
|
|
24
24
|
* @property {string} home - Name of the agent to start with
|
|
25
25
|
* @property {Writable} stdout - Stream to write output to
|
|
26
|
+
* @property {any[]} [messages] - Messages to add to the conversation
|
|
26
27
|
* @property {boolean} [verbose] - Whether to log verbose debug information
|
|
27
|
-
* @property {number} [maxSteps] - Maximum number of steps to execute
|
|
28
28
|
*/
|
|
29
29
|
export interface ExecuteAgentSetParams {
|
|
30
30
|
enrichWithMemory?: (role: string, agent: AgentConfig, context: AgenticContext) => Promise<string>;
|
|
31
31
|
query: string;
|
|
32
32
|
home?: string;
|
|
33
|
+
model?: string;
|
|
33
34
|
stdout: Writable;
|
|
35
|
+
messages?: any[];
|
|
34
36
|
verbose?: boolean;
|
|
37
|
+
json?: boolean;
|
|
38
|
+
schema?: any;
|
|
35
39
|
debug?: boolean;
|
|
36
40
|
}
|
|
37
41
|
/**
|
|
@@ -47,3 +51,13 @@ export interface ExecuteAgentSetParams {
|
|
|
47
51
|
*/
|
|
48
52
|
export declare function executeAgentSet(agentSet: AgentConfig[], context: AgenticContext, params: ExecuteAgentSetParams): Promise<ExecutionResult>;
|
|
49
53
|
export declare function executeAgent(agentSet: AgentConfig[], params: ExecuteAgentSetParams): Promise<ExecuteAgentResult>;
|
|
54
|
+
/**
|
|
55
|
+
* Executes a simple query without agent orchestration or tool handling
|
|
56
|
+
*
|
|
57
|
+
* This is the simplest level of execution - just sends a query to the LLM
|
|
58
|
+
* and returns the response. No tools, no agent transfers, no complex logic.
|
|
59
|
+
*
|
|
60
|
+
* @param params - Execution parameters including query and model config
|
|
61
|
+
* @returns Promise<ExecuteAgentResult> - Simple result with usage and content
|
|
62
|
+
*/
|
|
63
|
+
export declare function executeQuery(params: ExecuteAgentSetParams): Promise<ExecuteAgentResult>;
|