@droz-js/sdk 0.20.8 → 0.20.9
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/package.json +1 -1
- package/src/sdks/ai.d.ts +14 -4
- package/src/sdks/ai.js +4 -0
package/package.json
CHANGED
package/src/sdks/ai.d.ts
CHANGED
|
@@ -463,6 +463,12 @@ export type AiAgentScenario = {
|
|
|
463
463
|
export type AiAgentScenarioReport = {
|
|
464
464
|
/** Execuções que o prazo interrompeu antes de poderem ser julgadas. */
|
|
465
465
|
cut: Scalars['Int']['output'];
|
|
466
|
+
/**
|
|
467
|
+
* Por que a conversa foi para uma pessoa, contado entre as execuções julgadas. `customer_request` é
|
|
468
|
+
* entrega por decisão do agente; `provider_unavailable` e `unresolved` são desistência. A taxa
|
|
469
|
+
* sozinha não separa as duas.
|
|
470
|
+
*/
|
|
471
|
+
handoffReasons: Array<AiAgentMetricsCount>;
|
|
466
472
|
/** Execuções efetivamente julgadas. Zero significa que este cenário não produziu evidência. */
|
|
467
473
|
measured: Scalars['Int']['output'];
|
|
468
474
|
passed: Scalars['Int']['output'];
|
|
@@ -1042,7 +1048,10 @@ export type SaveAiAgentScenarioInput = {
|
|
|
1042
1048
|
* Expectativas de comportamento, uma por objeto, cada uma com `kind`. `tool_called` aceita
|
|
1043
1049
|
* `toolName` e `withArgs`; `tool_not_called` aceita `toolName`; `blocked_by_rule` aceita `category`
|
|
1044
1050
|
* para exigir o motivo; `stopped_for` aceita `reason`; `answer_omits` exige `terms`, e vale quando
|
|
1045
|
-
* nenhum termo aparece em nenhuma resposta da execucao, sem acento e sem caixa. `transferred
|
|
1051
|
+
* nenhum termo aparece em nenhuma resposta da execucao, sem acento e sem caixa. `transferred` vale
|
|
1052
|
+
* para qualquer passagem a uma pessoa — pedida pelo agente ou por orcamento estourado — e aceita
|
|
1053
|
+
* `reason` para cobrar um motivo especifico (`customer_request`, `tool_failure`,
|
|
1054
|
+
* `provider_unavailable`, `budget_exceeded`, `period_budget_exceeded`, `unresolved`).
|
|
1046
1055
|
* `not_transferred`, `answer_grounded` e `identification_required` nao levam campo — este ultimo
|
|
1047
1056
|
* vale quando alguma ferramenta do cenario foi recusada por falta de cliente identificado.
|
|
1048
1057
|
*/
|
|
@@ -1365,6 +1374,7 @@ export type SaveAiAgentScenarioMutation = {
|
|
|
1365
1374
|
export type AiAgentCheckRunFragment = (Pick<AiAgentCheckRun, 'runId' | 'agentId' | 'version' | 'status' | 'requestedAt' | 'startedAt' | 'finishedAt' | 'totalRuns' | 'completedRuns' | 'error'> & {
|
|
1366
1375
|
result?: Maybe<(Pick<AiAgentCheckResult, 'safeToPublish'> & {
|
|
1367
1376
|
reports: Array<(Pick<AiAgentScenarioReport, 'scenarioId' | 'runs' | 'cut' | 'measured' | 'passed' | 'rate'> & {
|
|
1377
|
+
handoffReasons: Array<Pick<AiAgentMetricsCount, 'key' | 'count'>>;
|
|
1368
1378
|
turns: Array<(Pick<AiAgentScenarioTurn, 'turn' | 'runs' | 'answered' | 'grounded' | 'blocked' | 'identificationRequired'> & {
|
|
1369
1379
|
toolNames: Array<Pick<AiAgentMetricsCount, 'key' | 'count'>>;
|
|
1370
1380
|
blockCategories: Array<Pick<AiAgentMetricsCount, 'key' | 'count'>>;
|
|
@@ -1527,7 +1537,7 @@ export declare const AiAgentProcedureFragmentDoc = "\n fragment aiAgentProced
|
|
|
1527
1537
|
export declare const AiAgentToolFragmentDoc = "\n fragment aiAgentTool on AiAgentTool {\n toolId\n name\n description\n effect\n availability\n requiresAuthenticatedCustomer\n onFailure\n customerScope\n returns\n approval\n parameters {\n name\n type\n required\n description\n grounding\n }\n}\n ";
|
|
1528
1538
|
export declare const AiAgentTraceFragmentDoc = "\n fragment aiAgentTrace on AiAgentTrace {\n sessionId\n turn\n agentId\n agentVersion\n input\n promptBuilderVersion\n masterRuleVersion\n identificationRequired\n promptFingerprint\n knowledgeOrigins\n outcome\n haltReason\n steps\n answer\n startedAt\n toolCalls {\n toolId\n name\n result\n ok\n connection\n errorClass\n }\n}\n ";
|
|
1529
1539
|
export declare const AiAgentScenarioFragmentDoc = "\n fragment aiAgentScenario on AiAgentScenario {\n scenarioId\n description\n customerId\n turns\n expectations\n}\n ";
|
|
1530
|
-
export declare const AiAgentCheckRunFragmentDoc = "\n fragment aiAgentCheckRun on AiAgentCheckRun {\n runId\n agentId\n version\n status\n requestedAt\n startedAt\n finishedAt\n totalRuns\n completedRuns\n error\n result {\n safeToPublish\n reports {\n scenarioId\n runs\n cut\n measured\n passed\n rate\n turns {\n turn\n runs\n answered\n grounded\n blocked\n identificationRequired\n toolNames {\n key\n count\n }\n blockCategories {\n key\n count\n }\n }\n }\n regressions {\n scenarioId\n before\n after\n }\n }\n}\n ";
|
|
1540
|
+
export declare const AiAgentCheckRunFragmentDoc = "\n fragment aiAgentCheckRun on AiAgentCheckRun {\n runId\n agentId\n version\n status\n requestedAt\n startedAt\n finishedAt\n totalRuns\n completedRuns\n error\n result {\n safeToPublish\n reports {\n scenarioId\n runs\n cut\n measured\n passed\n rate\n handoffReasons {\n key\n count\n }\n turns {\n turn\n runs\n answered\n grounded\n blocked\n identificationRequired\n toolNames {\n key\n count\n }\n blockCategories {\n key\n count\n }\n }\n }\n regressions {\n scenarioId\n before\n after\n }\n }\n}\n ";
|
|
1531
1541
|
export declare const AiAgentMetricsReportFragmentDoc = "\n fragment aiAgentMetricsReport on AiAgentMetrics {\n agentId\n from\n to\n truncated\n conversations\n conversationsResolved\n conversationsInconclusive\n conversationsHandoffRequested\n resolutionRate\n resolutionDefinition\n escalatedToHuman\n escalatedToFlow\n escalatedTargetUndeclared\n handoffsByReason {\n key\n count\n }\n humanRequestedTurns\n costMicroUsd\n costMicroUsdPerResolvedConversation\n unpricedTurns\n inputTokens\n outputTokens\n totalTokens\n cachedInputTokens\n cachedTurns\n llmCalls\n turnsByModel {\n key\n count\n }\n avgTurnDurationMs\n p95TurnDurationMs\n avgLlmLatencyMs\n turns\n answeredTurns\n answeredWithFailedConnectionTurns\n unansweredTurns\n unansweredDefinition\n topTopics {\n key\n count\n }\n topUnansweredQuestions {\n key\n count\n }\n blockedTurns\n blocksByCategory {\n key\n count\n }\n haltedTurns\n haltReasons {\n key\n count\n }\n budgetExceededTurns\n identificationRequiredTurns\n toolCalls\n toolCallsFailed\n toolErrorsByConnection {\n key\n count\n }\n toolErrorsByClass {\n key\n count\n }\n knowledgeRetrieved\n knowledgeEmpty\n knowledgeUnavailable\n knowledgeSkipped\n}\n ";
|
|
1532
1542
|
export declare const NlpInstanceFragmentDoc = "\n fragment nlpInstance on NlpInstance {\n id\n name\n drn\n options {\n transition\n samples\n }\n createdAt\n updatedAt\n}\n ";
|
|
1533
1543
|
export declare const QnaFragmentFragmentDoc = "\n fragment qnaFragment on QnAInstance {\n id\n name\n drn\n credentialsId\n tryToReplyOnTransition\n createdAt\n updatedAt\n}\n ";
|
|
@@ -1559,8 +1569,8 @@ export declare const RegisterAiAgentToolDocument = "\n mutation registerAiAge
|
|
|
1559
1569
|
export declare const UnregisterAiAgentToolDocument = "\n mutation unregisterAiAgentTool($input: UnregisterAiAgentToolInput!) {\n unregisterAiAgentTool(input: $input)\n}\n ";
|
|
1560
1570
|
export declare const RemoveAiAgentScenarioDocument = "\n mutation removeAiAgentScenario($input: RemoveAiAgentScenarioInput!) {\n removeAiAgentScenario(input: $input)\n}\n ";
|
|
1561
1571
|
export declare const SaveAiAgentScenarioDocument = "\n mutation saveAiAgentScenario($input: SaveAiAgentScenarioInput!) {\n saveAiAgentScenario(input: $input) {\n ...aiAgentScenario\n }\n}\n \n fragment aiAgentScenario on AiAgentScenario {\n scenarioId\n description\n customerId\n turns\n expectations\n}\n ";
|
|
1562
|
-
export declare const CheckAiAgentVersionDocument = "\n mutation checkAiAgentVersion($input: CheckAiAgentVersionInput!) {\n checkAiAgentVersion(input: $input) {\n ...aiAgentCheckRun\n }\n}\n \n fragment aiAgentCheckRun on AiAgentCheckRun {\n runId\n agentId\n version\n status\n requestedAt\n startedAt\n finishedAt\n totalRuns\n completedRuns\n error\n result {\n safeToPublish\n reports {\n scenarioId\n runs\n cut\n measured\n passed\n rate\n turns {\n turn\n runs\n answered\n grounded\n blocked\n identificationRequired\n toolNames {\n key\n count\n }\n blockCategories {\n key\n count\n }\n }\n }\n regressions {\n scenarioId\n before\n after\n }\n }\n}\n ";
|
|
1563
|
-
export declare const GetAiAgentCheckRunDocument = "\n query getAiAgentCheckRun($agentId: ID!, $runId: ID!) {\n getAiAgentCheckRun(agentId: $agentId, runId: $runId) {\n ...aiAgentCheckRun\n }\n}\n \n fragment aiAgentCheckRun on AiAgentCheckRun {\n runId\n agentId\n version\n status\n requestedAt\n startedAt\n finishedAt\n totalRuns\n completedRuns\n error\n result {\n safeToPublish\n reports {\n scenarioId\n runs\n cut\n measured\n passed\n rate\n turns {\n turn\n runs\n answered\n grounded\n blocked\n identificationRequired\n toolNames {\n key\n count\n }\n blockCategories {\n key\n count\n }\n }\n }\n regressions {\n scenarioId\n before\n after\n }\n }\n}\n ";
|
|
1572
|
+
export declare const CheckAiAgentVersionDocument = "\n mutation checkAiAgentVersion($input: CheckAiAgentVersionInput!) {\n checkAiAgentVersion(input: $input) {\n ...aiAgentCheckRun\n }\n}\n \n fragment aiAgentCheckRun on AiAgentCheckRun {\n runId\n agentId\n version\n status\n requestedAt\n startedAt\n finishedAt\n totalRuns\n completedRuns\n error\n result {\n safeToPublish\n reports {\n scenarioId\n runs\n cut\n measured\n passed\n rate\n handoffReasons {\n key\n count\n }\n turns {\n turn\n runs\n answered\n grounded\n blocked\n identificationRequired\n toolNames {\n key\n count\n }\n blockCategories {\n key\n count\n }\n }\n }\n regressions {\n scenarioId\n before\n after\n }\n }\n}\n ";
|
|
1573
|
+
export declare const GetAiAgentCheckRunDocument = "\n query getAiAgentCheckRun($agentId: ID!, $runId: ID!) {\n getAiAgentCheckRun(agentId: $agentId, runId: $runId) {\n ...aiAgentCheckRun\n }\n}\n \n fragment aiAgentCheckRun on AiAgentCheckRun {\n runId\n agentId\n version\n status\n requestedAt\n startedAt\n finishedAt\n totalRuns\n completedRuns\n error\n result {\n safeToPublish\n reports {\n scenarioId\n runs\n cut\n measured\n passed\n rate\n handoffReasons {\n key\n count\n }\n turns {\n turn\n runs\n answered\n grounded\n blocked\n identificationRequired\n toolNames {\n key\n count\n }\n blockCategories {\n key\n count\n }\n }\n }\n regressions {\n scenarioId\n before\n after\n }\n }\n}\n ";
|
|
1564
1574
|
export declare const AiAgentCheckLimitsDocument = "\n query aiAgentCheckLimits($agentId: ID!) {\n aiAgentCheckLimits(agentId: $agentId) {\n minRunsPerScenario\n maxRunsPerScenario\n maxSuiteRuns\n scenarioCount\n }\n}\n ";
|
|
1565
1575
|
export declare const AiAgentMetricsDocument = "\n query aiAgentMetrics($input: AiAgentMetricsInput!) {\n aiAgentMetrics(input: $input) {\n ...aiAgentMetricsReport\n }\n}\n \n fragment aiAgentMetricsReport on AiAgentMetrics {\n agentId\n from\n to\n truncated\n conversations\n conversationsResolved\n conversationsInconclusive\n conversationsHandoffRequested\n resolutionRate\n resolutionDefinition\n escalatedToHuman\n escalatedToFlow\n escalatedTargetUndeclared\n handoffsByReason {\n key\n count\n }\n humanRequestedTurns\n costMicroUsd\n costMicroUsdPerResolvedConversation\n unpricedTurns\n inputTokens\n outputTokens\n totalTokens\n cachedInputTokens\n cachedTurns\n llmCalls\n turnsByModel {\n key\n count\n }\n avgTurnDurationMs\n p95TurnDurationMs\n avgLlmLatencyMs\n turns\n answeredTurns\n answeredWithFailedConnectionTurns\n unansweredTurns\n unansweredDefinition\n topTopics {\n key\n count\n }\n topUnansweredQuestions {\n key\n count\n }\n blockedTurns\n blocksByCategory {\n key\n count\n }\n haltedTurns\n haltReasons {\n key\n count\n }\n budgetExceededTurns\n identificationRequiredTurns\n toolCalls\n toolCallsFailed\n toolErrorsByConnection {\n key\n count\n }\n toolErrorsByClass {\n key\n count\n }\n knowledgeRetrieved\n knowledgeEmpty\n knowledgeUnavailable\n knowledgeSkipped\n}\n ";
|
|
1566
1576
|
export declare const AiAgentVersionSpecDocument = "\n query aiAgentVersionSpec($agentId: ID!) {\n listAiAgentVersions(agentId: $agentId) {\n ...aiAgentVersionWithSpec\n }\n}\n \n fragment aiAgentVersionWithSpec on AiAgentVersion {\n agentId\n version\n status\n createdAt\n spec {\n ...aiAgentSpec\n }\n}\n \n\n fragment aiAgentSpec on AiAgentSpec {\n identity {\n displayName\n role\n tone\n toneNotes\n openingMessage\n outOfScopeBehaviour\n }\n can\n cannot\n knowledgeBaseIds\n knowledgeFallback\n toolIds\n budget {\n maxSteps\n maxToolCalls\n maxTokens\n maxCostMicroUsd\n maxPeriodCostMicroUsd\n onExceeded\n }\n handoff {\n transition\n target\n }\n channels\n}\n ";
|