File size: 1,231 Bytes
33340fe
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
# Application: `QAService`

**Code**: `adsp/app/qa_service.py`

## Purpose

`QAService` is the UI-facing entrypoint for interactive persona Q&A. It forwards queries into the Core layer’s orchestrator.

## Responsibilities

- Receive `(persona_id, query)` from the frontend
- Invoke the Core orchestration pipeline and return the final text response

## Public API

### `ask(persona_id: str, query: str) -> str`

**Inputs**
- `persona_id`: persona to use for voice/routing
- `query`: the user question

**Output**
- `str` response (persona answer)

## Internal logic (current)

1. Creates a new `core.orchestrator.Orchestrator()`
2. Calls `Orchestrator.handle_query(persona_id=persona_id, query=query)`

## Key dependencies / technologies

- `adsp/core/orchestrator/__init__.py` (`Orchestrator`)
- Python `dataclasses`

## Notes / production hardening

- The current implementation instantiates a new orchestrator per call; in production you would inject a long-lived orchestrator with configured dependencies (vector DB client, persona registry, cache, metrics).
- Add request metadata:
  - `session_id` (for memory)
  - `attachments` (PDF/image)
  - `requested_personas[]` (for “virtual focus group” multi-persona fan-out)