# makingchatbots/genesys-cloud-chatbot-tester architecture

> Architecture diagram of the GitHub repository makingchatbots/genesys-cloud-chatbot-tester, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-05). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/makingchatbots/genesys-cloud-chatbot-tester
- Repository: https://github.com/makingchatbots/genesys-cloud-chatbot-tester

## Overview

The CLI tests Genesys Cloud Web Messenger deployments through two workflows: deterministic scripted dialogues and AI-driven conversations. Both ultimately exercise the chatbot through the tester library’s guest session and conversation API. Scripted execution is visible in the sampled command and parser; the README documents AI testing and its providers, but the AI command’s orchestration was not sampled, so those internal links are marked unverified where needed.

Main entry points: [`packages/genesys-cloud-chatbot-tester-cli/src/commands/aiTest/createAiTestCommand.ts`](https://github.com/makingchatbots/genesys-cloud-chatbot-tester/blob/main/packages/genesys-cloud-chatbot-tester-cli/src/commands/aiTest/createAiTestCommand.ts) (AI test command), [`packages/genesys-cloud-chatbot-tester-cli/src/commands/scriptedTest/createScriptedTestCommand.ts`](https://github.com/makingchatbots/genesys-cloud-chatbot-tester/blob/main/packages/genesys-cloud-chatbot-tester-cli/src/commands/scriptedTest/createScriptedTestCommand.ts) (Scripted test), [`packages/genesys-cloud-chatbot-tester/src/genesys/WebMessengerGuestSession.ts`](https://github.com/makingchatbots/genesys-cloud-chatbot-tester/blob/main/packages/genesys-cloud-chatbot-tester/src/genesys/WebMessengerGuestSession.ts) (Guest session), [`packages/genesys-cloud-chatbot-tester/src/Conversation.ts`](https://github.com/makingchatbots/genesys-cloud-chatbot-tester/blob/main/packages/genesys-cloud-chatbot-tester/src/Conversation.ts) (Conversation API)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_cli["CLI workflows"]
  node_cli_entry["CLI entry<br/>[createCli.ts]"]
  node_script_command["Scripted test"]
  node_yaml_reader["YAML reader<br/>[yamlFileReader.ts]"]
  node_script_parser["Script parser<br/>[parseTestScript.ts]"]
  node_script_results["Scenario results<br/>[ScenarioResult.ts]"]
end

subgraph group_ai["AI testing"]
  node_ai_command["AI test command"]
  node_prompt_generator["Prompt generation<br/>[promptGenerator.ts]"]
  node_ai_termination["Conversation stopping"]
  node_completion_client["Completion interface"]
  node_chatgpt["ChatGPT client"]
  node_gemini["Gemini client"]
  node_ai_output["AI result output<br/>[saveOutputJson.ts]"]
end

subgraph group_messaging["Web Messenger runtime"]
  node_conversation["Conversation API<br/>[Conversation.ts]"]
  node_guest_session["Guest session"]
  node_message_delayer["Message ordering"]
  node_response_types["Message types"]
end

subgraph group_platform["Genesys integration"]
  node_genesys(("Genesys deployment"))
  node_openai_service["OpenAI API"]
  node_gemini_service["Google Gemini API"]
end

node_user(("CLI user"))

node_user -->|"runs command"| node_cli_entry
node_cli_entry -->|"registers"| node_script_command
node_cli_entry -->|"registers"| node_ai_command
node_script_command -->|"reads script"| node_yaml_reader
node_script_command -->|"extracts scenarios"| node_script_parser
node_script_command -->|"records outcomes"| node_script_results
node_script_parser -->|"creates conversation steps"| node_conversation
node_script_command -->|"runs scenarios"| node_conversation
node_conversation -->|"sends and receives"| node_guest_session
node_guest_session -->|"opens guest session"| node_genesys
node_guest_session -->|"buffers messages"| node_message_delayer
node_message_delayer -->|"orders responses"| node_response_types
node_guest_session -->|"parses responses"| node_response_types
node_ai_command -.->|"builds prompts"| node_prompt_generator
node_ai_command -.->|"requests completions"| node_completion_client
node_ai_command -.->|"tests deployment"| node_conversation
node_ai_command -.->|"checks stop phrases"| node_ai_termination
node_ai_command -.->|"saves results"| node_ai_output
node_completion_client -->|"implemented by"| node_chatgpt
node_completion_client -->|"implemented by"| node_gemini
node_chatgpt -->|"requests completions"| node_openai_service
node_gemini -->|"requests completions"| node_gemini_service

click node_cli_entry "https://github.com/makingchatbots/genesys-cloud-chatbot-tester/blob/main/packages/genesys-cloud-chatbot-tester-cli/src/createCli.ts"
click node_script_command "https://github.com/makingchatbots/genesys-cloud-chatbot-tester/blob/main/packages/genesys-cloud-chatbot-tester-cli/src/commands/scriptedTest/createScriptedTestCommand.ts"
click node_yaml_reader "https://github.com/makingchatbots/genesys-cloud-chatbot-tester/blob/main/packages/genesys-cloud-chatbot-tester-cli/src/fileSystem/yamlFileReader.ts"
click node_script_parser "https://github.com/makingchatbots/genesys-cloud-chatbot-tester/blob/main/packages/genesys-cloud-chatbot-tester-cli/src/commands/scriptedTest/testScript/parseTestScript.ts"
click node_script_results "https://github.com/makingchatbots/genesys-cloud-chatbot-tester/blob/main/packages/genesys-cloud-chatbot-tester-cli/src/commands/scriptedTest/ScenarioResult.ts"
click node_ai_command "https://github.com/makingchatbots/genesys-cloud-chatbot-tester/blob/main/packages/genesys-cloud-chatbot-tester-cli/src/commands/aiTest/createAiTestCommand.ts"
click node_prompt_generator "https://github.com/makingchatbots/genesys-cloud-chatbot-tester/blob/main/packages/genesys-cloud-chatbot-tester-cli/src/commands/aiTest/prompt/generation/promptGenerator.ts"
click node_ai_termination "https://github.com/makingchatbots/genesys-cloud-chatbot-tester/blob/main/packages/genesys-cloud-chatbot-tester-cli/src/commands/aiTest/prompt/shouldEndConversation.ts"
click node_completion_client "https://github.com/makingchatbots/genesys-cloud-chatbot-tester/blob/main/packages/genesys-cloud-chatbot-tester-cli/src/commands/aiTest/chatCompletionClients/chatCompletionClient.ts"
click node_chatgpt "https://github.com/makingchatbots/genesys-cloud-chatbot-tester/blob/main/packages/genesys-cloud-chatbot-tester-cli/src/commands/aiTest/chatCompletionClients/chatGpt/createChatCompletionClient.ts"
click node_gemini "https://github.com/makingchatbots/genesys-cloud-chatbot-tester/blob/main/packages/genesys-cloud-chatbot-tester-cli/src/commands/aiTest/chatCompletionClients/googleGemini/createChatCompletionClient.ts"
click node_ai_output "https://github.com/makingchatbots/genesys-cloud-chatbot-tester/blob/main/packages/genesys-cloud-chatbot-tester-cli/src/commands/aiTest/output/saveOutputJson.ts"
click node_conversation "https://github.com/makingchatbots/genesys-cloud-chatbot-tester/blob/main/packages/genesys-cloud-chatbot-tester/src/Conversation.ts"
click node_guest_session "https://github.com/makingchatbots/genesys-cloud-chatbot-tester/blob/main/packages/genesys-cloud-chatbot-tester/src/genesys/WebMessengerGuestSession.ts"
click node_message_delayer "https://github.com/makingchatbots/genesys-cloud-chatbot-tester/blob/main/packages/genesys-cloud-chatbot-tester/src/genesys/message-delayer/ReorderedMessageDelayer.ts"
click node_response_types "https://github.com/makingchatbots/genesys-cloud-chatbot-tester/blob/main/packages/genesys-cloud-chatbot-tester/src/genesys/StructuredMessage.ts"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_cli_entry,node_script_command,node_yaml_reader,node_script_parser,node_script_results,node_user toneBlue
class node_ai_command,node_prompt_generator,node_ai_termination,node_completion_client,node_chatgpt,node_gemini,node_ai_output toneAmber
class node_conversation,node_guest_session,node_message_delayer,node_response_types toneMint
class node_genesys,node_openai_service,node_gemini_service toneRose
```

## Components

### CLI workflows

- [CLI entry](https://github.com/makingchatbots/genesys-cloud-chatbot-tester/blob/main/packages/genesys-cloud-chatbot-tester-cli/src/createCli.ts): `packages/genesys-cloud-chatbot-tester-cli/src/createCli.ts`
- [Scripted test](https://github.com/makingchatbots/genesys-cloud-chatbot-tester/blob/main/packages/genesys-cloud-chatbot-tester-cli/src/commands/scriptedTest/createScriptedTestCommand.ts): `packages/genesys-cloud-chatbot-tester-cli/src/commands/scriptedTest/createScriptedTestCommand.ts`
- [YAML reader](https://github.com/makingchatbots/genesys-cloud-chatbot-tester/blob/main/packages/genesys-cloud-chatbot-tester-cli/src/fileSystem/yamlFileReader.ts): `packages/genesys-cloud-chatbot-tester-cli/src/fileSystem/yamlFileReader.ts`
- [Script parser](https://github.com/makingchatbots/genesys-cloud-chatbot-tester/blob/main/packages/genesys-cloud-chatbot-tester-cli/src/commands/scriptedTest/testScript/parseTestScript.ts): `packages/genesys-cloud-chatbot-tester-cli/src/commands/scriptedTest/testScript/parseTestScript.ts`
- [Scenario results](https://github.com/makingchatbots/genesys-cloud-chatbot-tester/blob/main/packages/genesys-cloud-chatbot-tester-cli/src/commands/scriptedTest/ScenarioResult.ts): `packages/genesys-cloud-chatbot-tester-cli/src/commands/scriptedTest/ScenarioResult.ts`

### AI testing

- [AI test command](https://github.com/makingchatbots/genesys-cloud-chatbot-tester/blob/main/packages/genesys-cloud-chatbot-tester-cli/src/commands/aiTest/createAiTestCommand.ts): `packages/genesys-cloud-chatbot-tester-cli/src/commands/aiTest/createAiTestCommand.ts`
- [Prompt generation](https://github.com/makingchatbots/genesys-cloud-chatbot-tester/blob/main/packages/genesys-cloud-chatbot-tester-cli/src/commands/aiTest/prompt/generation/promptGenerator.ts): `packages/genesys-cloud-chatbot-tester-cli/src/commands/aiTest/prompt/generation/promptGenerator.ts`
- [Conversation stopping](https://github.com/makingchatbots/genesys-cloud-chatbot-tester/blob/main/packages/genesys-cloud-chatbot-tester-cli/src/commands/aiTest/prompt/shouldEndConversation.ts): `packages/genesys-cloud-chatbot-tester-cli/src/commands/aiTest/prompt/shouldEndConversation.ts`
- [Completion interface](https://github.com/makingchatbots/genesys-cloud-chatbot-tester/blob/main/packages/genesys-cloud-chatbot-tester-cli/src/commands/aiTest/chatCompletionClients/chatCompletionClient.ts): `packages/genesys-cloud-chatbot-tester-cli/src/commands/aiTest/chatCompletionClients/chatCompletionClient.ts`
- [ChatGPT client](https://github.com/makingchatbots/genesys-cloud-chatbot-tester/blob/main/packages/genesys-cloud-chatbot-tester-cli/src/commands/aiTest/chatCompletionClients/chatGpt/createChatCompletionClient.ts): `packages/genesys-cloud-chatbot-tester-cli/src/commands/aiTest/chatCompletionClients/chatGpt/createChatCompletionClient.ts`
- [Gemini client](https://github.com/makingchatbots/genesys-cloud-chatbot-tester/blob/main/packages/genesys-cloud-chatbot-tester-cli/src/commands/aiTest/chatCompletionClients/googleGemini/createChatCompletionClient.ts): `packages/genesys-cloud-chatbot-tester-cli/src/commands/aiTest/chatCompletionClients/googleGemini/createChatCompletionClient.ts`
- [AI result output](https://github.com/makingchatbots/genesys-cloud-chatbot-tester/blob/main/packages/genesys-cloud-chatbot-tester-cli/src/commands/aiTest/output/saveOutputJson.ts): `packages/genesys-cloud-chatbot-tester-cli/src/commands/aiTest/output/saveOutputJson.ts`

### Web Messenger runtime

- [Conversation API](https://github.com/makingchatbots/genesys-cloud-chatbot-tester/blob/main/packages/genesys-cloud-chatbot-tester/src/Conversation.ts): `packages/genesys-cloud-chatbot-tester/src/Conversation.ts`
- [Guest session](https://github.com/makingchatbots/genesys-cloud-chatbot-tester/blob/main/packages/genesys-cloud-chatbot-tester/src/genesys/WebMessengerGuestSession.ts): `packages/genesys-cloud-chatbot-tester/src/genesys/WebMessengerGuestSession.ts`
- [Message ordering](https://github.com/makingchatbots/genesys-cloud-chatbot-tester/blob/main/packages/genesys-cloud-chatbot-tester/src/genesys/message-delayer/ReorderedMessageDelayer.ts): `packages/genesys-cloud-chatbot-tester/src/genesys/message-delayer/ReorderedMessageDelayer.ts`
- [Message types](https://github.com/makingchatbots/genesys-cloud-chatbot-tester/blob/main/packages/genesys-cloud-chatbot-tester/src/genesys/StructuredMessage.ts): `packages/genesys-cloud-chatbot-tester/src/genesys/StructuredMessage.ts`

### Genesys integration

- **Genesys deployment**
- **OpenAI API**
- **Google Gemini API**

### Other components

- **CLI user**

## Connections

- CLI user → CLI entry: runs command
- CLI entry → Scripted test: registers (evidence: `packages/genesys-cloud-chatbot-tester-cli/src/createCli.ts`)
- CLI entry → AI test command: registers (evidence: `packages/genesys-cloud-chatbot-tester-cli/src/createCli.ts`)
- Scripted test → YAML reader: reads script (evidence: `packages/genesys-cloud-chatbot-tester-cli/src/commands/scriptedTest/createScriptedTestCommand.ts`)
- Scripted test → Script parser: extracts scenarios (evidence: `packages/genesys-cloud-chatbot-tester-cli/src/commands/scriptedTest/createScriptedTestCommand.ts`)
- Scripted test → Scenario results: records outcomes (evidence: `packages/genesys-cloud-chatbot-tester-cli/src/commands/scriptedTest/createScriptedTestCommand.ts`)
- Script parser → Conversation API: creates conversation steps (evidence: `packages/genesys-cloud-chatbot-tester-cli/src/commands/scriptedTest/testScript/parseTestScript.ts`)
- Scripted test → Conversation API: runs scenarios (evidence: `packages/genesys-cloud-chatbot-tester-cli/src/commands/scriptedTest/createScriptedTestCommand.ts`)
- Conversation API → Guest session: sends and receives (evidence: `packages/genesys-cloud-chatbot-tester/src/Conversation.ts`)
- Guest session → Genesys deployment: opens guest session (evidence: `packages/genesys-cloud-chatbot-tester/src/genesys/WebMessengerGuestSession.ts`)
- Guest session → Message ordering: buffers messages (evidence: `packages/genesys-cloud-chatbot-tester/src/genesys/WebMessengerGuestSession.ts`)
- Message ordering → Message types: orders responses (evidence: `packages/genesys-cloud-chatbot-tester/src/genesys/message-delayer/ReorderedMessageDelayer.ts`)
- Guest session → Message types: parses responses (evidence: `packages/genesys-cloud-chatbot-tester/src/genesys/WebMessengerGuestSession.ts`)
- AI test command → Prompt generation: builds prompts (evidence: `packages/genesys-cloud-chatbot-tester-cli/src/commands/aiTest/createAiTestCommand.ts`)
- AI test command → Completion interface: requests completions (evidence: `packages/genesys-cloud-chatbot-tester-cli/src/commands/aiTest/createAiTestCommand.ts`)
- AI test command → Conversation API: tests deployment
- AI test command → Conversation stopping: checks stop phrases (evidence: `packages/genesys-cloud-chatbot-tester-cli/src/commands/aiTest/createAiTestCommand.ts`)
- AI test command → AI result output: saves results (evidence: `packages/genesys-cloud-chatbot-tester-cli/src/commands/aiTest/createAiTestCommand.ts`)
- Completion interface → ChatGPT client: implemented by (evidence: `packages/genesys-cloud-chatbot-tester-cli/src/commands/aiTest/chatCompletionClients/chatGpt/createChatCompletionClient.ts`)
- Completion interface → Gemini client: implemented by (evidence: `packages/genesys-cloud-chatbot-tester-cli/src/commands/aiTest/chatCompletionClients/googleGemini/createChatCompletionClient.ts`)
- ChatGPT client → OpenAI API: requests completions (evidence: `packages/genesys-cloud-chatbot-tester-cli/src/commands/aiTest/chatCompletionClients/chatGpt/createChatCompletionClient.ts`)
- Gemini client → Google Gemini API: requests completions (evidence: `packages/genesys-cloud-chatbot-tester-cli/src/commands/aiTest/chatCompletionClients/googleGemini/createChatCompletionClient.ts`)
