Document the new configuration and processing workflow
This commit is contained in:
74
examples/README.md
Normal file
74
examples/README.md
Normal file
@@ -0,0 +1,74 @@
|
||||
# Maintained examples
|
||||
|
||||
Build Audita from the repository root with Go 1.27 or newer. The commands below
|
||||
assume the executable is on `PATH`. Each project selects its main file from its
|
||||
own directory, which also determines companion resources and overlay context.
|
||||
All models, credentials, names, and endpoints are illustrative.
|
||||
|
||||
## Local processing
|
||||
|
||||
From `examples/local`, edit `prompts.yml` to match a reachable OpenAI-compatible
|
||||
local service and its model. Then run:
|
||||
|
||||
```sh
|
||||
audita config validate --config config.yml
|
||||
audita process --config config.yml --output corrected.json transcript.json
|
||||
```
|
||||
|
||||
Processing makes model requests. Reports are written beside the selected output
|
||||
unless disabled. For an offline validator preview, from the same directory:
|
||||
|
||||
```sh
|
||||
audita promptkit show prepared audita/validators.meaning_reversal_review \
|
||||
--config config.yml --profile local \
|
||||
--var "PayloadJSON=$(cat validation-candidate.json)" \
|
||||
--var 'TranscriptDescriptionBlock='
|
||||
```
|
||||
|
||||
This renders the supplied candidate without inference. The native command help
|
||||
and [CLI reference](../docs/cli.md) describe additional inspection and validation.
|
||||
|
||||
## Service and overlay
|
||||
|
||||
From `examples/service`, edit the synthetic endpoint and models in `prompts.yml`.
|
||||
Set `AUDITA_EXAMPLE_KEY` to your service credential before a real request. Inspect
|
||||
without a provider call:
|
||||
|
||||
```sh
|
||||
audita config validate --config config.yml --overlay testing
|
||||
audita promptkit show profile service-test --config config.yml
|
||||
```
|
||||
|
||||
The example does not promise a provider's model availability, price, or quality.
|
||||
|
||||
## Edit a prompt and run again
|
||||
|
||||
From `examples/prompt-edit`, inspect the operator replacement:
|
||||
|
||||
```sh
|
||||
audita promptkit show prompt audita/modules.grammar.proposal --config config.yml
|
||||
```
|
||||
|
||||
Edit its message in `prompts.yml`, repeat the inspection, and run `audita process
|
||||
--config config.yml --output corrected.json transcript.json` against a configured
|
||||
local service. Each invocation captures the files anew.
|
||||
|
||||
## Shared glossary library
|
||||
|
||||
From `examples/campaigns`, `first.yml` and `second.yml` each consume the common
|
||||
`shared.yml` through the companion `glossary.yml`. Inspect each configuration:
|
||||
|
||||
```sh
|
||||
audita config validate --config first.yml
|
||||
audita config validate --config second.yml
|
||||
```
|
||||
|
||||
With a local service configured, process either campaign:
|
||||
|
||||
```sh
|
||||
audita process --config first.yml --output first-output.json transcript.json
|
||||
audita process --config second.yml --output second-output.json transcript.json
|
||||
```
|
||||
|
||||
Edit `prompts.yml` for a local service before processing either campaign. The
|
||||
first uses separate party and spell corrections; the second selects only party.
|
||||
8
examples/campaigns/first.yml
Normal file
8
examples/campaigns/first.yml
Normal file
@@ -0,0 +1,8 @@
|
||||
version: 3
|
||||
llm: {proposal_profile: local}
|
||||
glossaries: [party, spells]
|
||||
pipeline:
|
||||
stages:
|
||||
- {id: names, module: glossary, glossaries: [party]}
|
||||
- {id: magic, module: glossary, glossaries: [spells]}
|
||||
- {module: grammar}
|
||||
4
examples/campaigns/glossary.yml
Normal file
4
examples/campaigns/glossary.yml
Normal file
@@ -0,0 +1,4 @@
|
||||
config:
|
||||
imports:
|
||||
- path: shared.yml
|
||||
required: true
|
||||
5
examples/campaigns/prompts.yml
Normal file
5
examples/campaigns/prompts.yml
Normal file
@@ -0,0 +1,5 @@
|
||||
profiles:
|
||||
- id: local
|
||||
endpoint: http://localhost:11434/v1
|
||||
model: example-model
|
||||
api_key_required: false
|
||||
7
examples/campaigns/second.yml
Normal file
7
examples/campaigns/second.yml
Normal file
@@ -0,0 +1,7 @@
|
||||
version: 3
|
||||
llm: {proposal_profile: local}
|
||||
glossaries: [party]
|
||||
pipeline:
|
||||
stages:
|
||||
- {id: names, module: glossary}
|
||||
- {module: grammar}
|
||||
12
examples/campaigns/shared.yml
Normal file
12
examples/campaigns/shared.yml
Normal file
@@ -0,0 +1,12 @@
|
||||
party:
|
||||
entries:
|
||||
- id: lyra
|
||||
name: Lyra
|
||||
category: character
|
||||
description: A fictional adventurer.
|
||||
spells:
|
||||
entries:
|
||||
- id: shield
|
||||
name: Shield
|
||||
category: spell
|
||||
aliases: [Ward]
|
||||
9
examples/campaigns/transcript.json
Normal file
9
examples/campaigns/transcript.json
Normal file
@@ -0,0 +1,9 @@
|
||||
[
|
||||
{
|
||||
"id": 1,
|
||||
"speaker": "Narrator",
|
||||
"start": 0,
|
||||
"end": 2,
|
||||
"text": "Lyra raises a ward before the journey."
|
||||
}
|
||||
]
|
||||
@@ -1,15 +0,0 @@
|
||||
version: 2
|
||||
profiles_dir: profiles/local
|
||||
backends:
|
||||
local-base:
|
||||
endpoint: http://127.0.0.1:11434/v1
|
||||
concurrency: 4
|
||||
queue_capacity: 0
|
||||
local:
|
||||
extends: local-base
|
||||
concurrency: 2
|
||||
llm:
|
||||
proposal_profile: local-proposal
|
||||
validation_profile: local-validation
|
||||
pipeline:
|
||||
modules: [grammar]
|
||||
8
examples/local/config.yml
Normal file
8
examples/local/config.yml
Normal file
@@ -0,0 +1,8 @@
|
||||
version: 3
|
||||
llm:
|
||||
proposal_profile: local
|
||||
pipeline:
|
||||
stages:
|
||||
- module: glossary
|
||||
- module: grammar
|
||||
glossaries: [party]
|
||||
7
examples/local/glossary.yml
Normal file
7
examples/local/glossary.yml
Normal file
@@ -0,0 +1,7 @@
|
||||
party:
|
||||
entries:
|
||||
- id: jesters
|
||||
name: Jesters
|
||||
category: faction
|
||||
description: A traveling group of performers.
|
||||
aliases: [Jester]
|
||||
5
examples/local/prompts.yml
Normal file
5
examples/local/prompts.yml
Normal file
@@ -0,0 +1,5 @@
|
||||
profiles:
|
||||
- id: local
|
||||
endpoint: http://localhost:11434/v1
|
||||
model: example-model
|
||||
api_key_required: false
|
||||
9
examples/local/transcript.json
Normal file
9
examples/local/transcript.json
Normal file
@@ -0,0 +1,9 @@
|
||||
[
|
||||
{
|
||||
"id": 1,
|
||||
"speaker": "Narrator",
|
||||
"start": 0,
|
||||
"end": 2,
|
||||
"text": "The gestures gather beside the stage."
|
||||
}
|
||||
]
|
||||
1
examples/local/validation-candidate.json
Normal file
1
examples/local/validation-candidate.json
Normal file
@@ -0,0 +1 @@
|
||||
[{"correction_index":1,"original_text":"not open","corrected_text":"open","original_segment_text":"The door is not open.","corrected_segment_text":"The door is open."}]
|
||||
@@ -1,13 +0,0 @@
|
||||
version: 2
|
||||
profiles_dir: profiles/local
|
||||
backends:
|
||||
local:
|
||||
endpoint: http://127.0.0.1:11434/v1
|
||||
concurrency: 1
|
||||
llm:
|
||||
proposal_profile: local-proposal
|
||||
validation_profile: local-validation
|
||||
pipeline:
|
||||
modules: [grammar]
|
||||
output:
|
||||
schema: bare-segments
|
||||
@@ -1,3 +0,0 @@
|
||||
llm:
|
||||
proposal_profile: service-proposal-testing
|
||||
validation_profile: service-validation-testing
|
||||
@@ -1,41 +0,0 @@
|
||||
version: 2
|
||||
profiles_dir: profiles/service
|
||||
backends:
|
||||
service:
|
||||
endpoint: https://openrouter.ai/api/v1
|
||||
credential: AUDITA_SERVICE_KEY
|
||||
concurrency: 2
|
||||
queue_capacity: 1024
|
||||
llm:
|
||||
proposal_profile: service-proposal
|
||||
validation_profile: service-validation
|
||||
transient_retries: 2
|
||||
repair_attempts: 2
|
||||
operation_timeout: 15m
|
||||
pipeline:
|
||||
modules: [glossary, homophones, glossary, spoken_word, grammar]
|
||||
output:
|
||||
schema: audita-v1
|
||||
chunking:
|
||||
# Requires at least this many normalized segments; omit for automatic chunking.
|
||||
target_sections: 8
|
||||
max_section_tokens: 8192
|
||||
min_section_tokens: 2048
|
||||
normalization:
|
||||
max_segment_gap: 4.0
|
||||
ellipsis_gap: 3.5
|
||||
max_segment_duration: 60.0
|
||||
max_segment_tokens: 2048
|
||||
thresholds:
|
||||
glossary: 0.8
|
||||
homophones: 0.8
|
||||
spoken_word: 0.8
|
||||
grammar: 0.8
|
||||
context:
|
||||
description: "General context for domain vocabulary and speaker names."
|
||||
reporting:
|
||||
enabled: true
|
||||
stdout_dir: .
|
||||
diagnostics:
|
||||
debug: false
|
||||
work_dir: /tmp/audita
|
||||
@@ -1,8 +0,0 @@
|
||||
profiles:
|
||||
local-proposal:
|
||||
backend: local
|
||||
model: replace-with-local-model
|
||||
temperature: 0
|
||||
max_tokens: 2048
|
||||
top_p: 1
|
||||
timeout_seconds: 120
|
||||
@@ -1,8 +0,0 @@
|
||||
profiles:
|
||||
local-validation:
|
||||
backend: local
|
||||
model: replace-with-local-model
|
||||
temperature: 0
|
||||
max_tokens: 1024
|
||||
top_p: 1
|
||||
timeout_seconds: 120
|
||||
@@ -1,8 +0,0 @@
|
||||
profiles:
|
||||
service-proposal-testing:
|
||||
backend: service
|
||||
model: replace-with-testing-model
|
||||
temperature: 0
|
||||
max_tokens: 2048
|
||||
top_p: 1
|
||||
timeout_seconds: 120
|
||||
@@ -1,8 +0,0 @@
|
||||
profiles:
|
||||
service-proposal:
|
||||
backend: service
|
||||
model: replace-with-provider-model
|
||||
temperature: 0
|
||||
max_tokens: 2048
|
||||
top_p: 1
|
||||
timeout_seconds: 120
|
||||
@@ -1,8 +0,0 @@
|
||||
profiles:
|
||||
service-validation-testing:
|
||||
backend: service
|
||||
model: replace-with-testing-model
|
||||
temperature: 0
|
||||
max_tokens: 1024
|
||||
top_p: 1
|
||||
timeout_seconds: 120
|
||||
@@ -1,8 +0,0 @@
|
||||
profiles:
|
||||
service-validation:
|
||||
backend: service
|
||||
model: replace-with-provider-model
|
||||
temperature: 0
|
||||
max_tokens: 1024
|
||||
top_p: 1
|
||||
timeout_seconds: 120
|
||||
8
examples/prompt-edit/config.yml
Normal file
8
examples/prompt-edit/config.yml
Normal file
@@ -0,0 +1,8 @@
|
||||
version: 3
|
||||
llm:
|
||||
proposal_profile: local
|
||||
pipeline:
|
||||
stages:
|
||||
- module: glossary
|
||||
- module: grammar
|
||||
glossaries: [party]
|
||||
7
examples/prompt-edit/glossary.yml
Normal file
7
examples/prompt-edit/glossary.yml
Normal file
@@ -0,0 +1,7 @@
|
||||
party:
|
||||
entries:
|
||||
- id: jesters
|
||||
name: Jesters
|
||||
category: faction
|
||||
description: A traveling group of performers.
|
||||
aliases: [Jester]
|
||||
23
examples/prompt-edit/prompts.yml
Normal file
23
examples/prompt-edit/prompts.yml
Normal file
@@ -0,0 +1,23 @@
|
||||
profiles:
|
||||
- id: local
|
||||
endpoint: http://localhost:11434/v1
|
||||
model: example-model
|
||||
api_key_required: false
|
||||
collections:
|
||||
audita:
|
||||
prompts:
|
||||
- id: modules.grammar.proposal
|
||||
messages:
|
||||
- role: system
|
||||
content: Correct only clearly supported grammatical errors.
|
||||
- role: user
|
||||
content: |
|
||||
{{ .ProposalContract }}
|
||||
{{ .HardeningPolicy }}
|
||||
{{ .TranscriptDescriptionBlock }}
|
||||
Glossary: {{ .GlossaryJSON }}
|
||||
Transcript: {{ .SectionJSON }}
|
||||
output:
|
||||
format: json
|
||||
validation_mode: json_schema
|
||||
schema_path: correction_set.v1.json
|
||||
9
examples/prompt-edit/transcript.json
Normal file
9
examples/prompt-edit/transcript.json
Normal file
@@ -0,0 +1,9 @@
|
||||
[
|
||||
{
|
||||
"id": 1,
|
||||
"speaker": "Narrator",
|
||||
"start": 0,
|
||||
"end": 2,
|
||||
"text": "The gestures gather beside the stage."
|
||||
}
|
||||
]
|
||||
7
examples/service/config.yml
Normal file
7
examples/service/config.yml
Normal file
@@ -0,0 +1,7 @@
|
||||
version: 3
|
||||
llm:
|
||||
proposal_profile: service-proposal
|
||||
validation_profile: service-review
|
||||
pipeline:
|
||||
stages:
|
||||
- module: grammar
|
||||
3
examples/service/overlays/testing.yml
Normal file
3
examples/service/overlays/testing.yml
Normal file
@@ -0,0 +1,3 @@
|
||||
llm:
|
||||
proposal_profile: service-test
|
||||
validation_profile: service-test
|
||||
16
examples/service/prompts.yml
Normal file
16
examples/service/prompts.yml
Normal file
@@ -0,0 +1,16 @@
|
||||
backends:
|
||||
- id: service
|
||||
endpoint: https://example.invalid/v1
|
||||
api_key_env: AUDITA_EXAMPLE_KEY
|
||||
concurrency_limit: 2
|
||||
queue_capacity: 8
|
||||
profiles:
|
||||
- id: service-proposal
|
||||
backend: service
|
||||
model: example-proposal-model
|
||||
- id: service-review
|
||||
backend: service
|
||||
model: example-review-model
|
||||
- id: service-test
|
||||
extends: {id: service-proposal}
|
||||
model: example-testing-model
|
||||
9
examples/service/transcript.json
Normal file
9
examples/service/transcript.json
Normal file
@@ -0,0 +1,9 @@
|
||||
[
|
||||
{
|
||||
"id": 1,
|
||||
"speaker": "Narrator",
|
||||
"start": 0,
|
||||
"end": 2,
|
||||
"text": "The gestures gather beside the stage."
|
||||
}
|
||||
]
|
||||
@@ -1,6 +0,0 @@
|
||||
glossary:
|
||||
- name: Audita
|
||||
aliases:
|
||||
- audita
|
||||
category: product
|
||||
summary: The Audita transcript correction CLI.
|
||||
Reference in New Issue
Block a user