You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
97 lines
3.4 KiB
Markdown
97 lines
3.4 KiB
Markdown
# Fastlane Gitea
|
|
|
|
Prompt- und Schema-Definitionen fuer **Fastlane** — die KI-Schnittstelle zwischen Fachanwendern und einem externen System. Claude analysiert natuerlichsprachliche Anfragen und liefert strukturierte JSON-Antworten, die vom Flutter-Frontend gerendert werden.
|
|
|
|
## Verzeichnisstruktur
|
|
|
|
```
|
|
prompts/ # System-Prompts (steuern Claudes Verhalten)
|
|
schemas/ # JSON-Schemas (definieren die Antwortstruktur)
|
|
```
|
|
|
|
## Prompts (`prompts/`)
|
|
|
|
Jeder Prompt ist eine JSON-Datei mit folgendem Aufbau:
|
|
|
|
```json
|
|
{
|
|
"key": "unique_identifier",
|
|
"description": "Kurzbeschreibung des Prompts",
|
|
"response_schema_ref": "fastlane_response.schema.json",
|
|
"tags": ["tag1", "tag2"],
|
|
"system_prompt": "Der vollstaendige System-Prompt als String"
|
|
}
|
|
```
|
|
|
|
| Feld | Beschreibung |
|
|
|-----------------------|-------------------------------------------------------|
|
|
| `key` | Eindeutiger Bezeichner |
|
|
| `description` | Was der Prompt tut |
|
|
| `response_schema_ref` | Verweis auf das JSON-Schema fuer die Antwort |
|
|
| `tags` | Kategorisierung (z.B. `general`, `fleet`, `energy`) |
|
|
| `system_prompt` | Instruktionen an Claude |
|
|
|
|
## Schemas (`schemas/`)
|
|
|
|
JSON-Schema-Dateien (Draft-07), die die Antwortstruktur validieren.
|
|
|
|
### Antwort-Modi
|
|
|
|
Claude antwortet immer mit **einem** von zwei Modi:
|
|
|
|
#### `response_type: "form"`
|
|
Wird verwendet, wenn Claude **zusaetzliche Informationen** braucht. Generiert ein Formular, das im Flutter-Frontend via `flutter_form_builder` gerendert wird.
|
|
|
|
```json
|
|
{
|
|
"response_type": "form",
|
|
"message": "Bitte waehle den Zeitraum aus.",
|
|
"form": {
|
|
"title": "Zeitraum waehlen",
|
|
"fields": [
|
|
{
|
|
"name": "zeitraum",
|
|
"widget": "date_range_picker",
|
|
"label": "Zeitraum",
|
|
"validators": [{ "type": "required" }]
|
|
}
|
|
]
|
|
}
|
|
}
|
|
```
|
|
|
|
#### `response_type: "result"`
|
|
Wird verwendet, wenn Claude **alle Informationen** hat. Kann HTML, Intents und Code-Bloecke enthalten.
|
|
|
|
```json
|
|
{
|
|
"response_type": "result",
|
|
"message": "Hier ist die Uebersicht.",
|
|
"html_content": "<table>...</table>",
|
|
"intents": [{ "action": "notify", "params": { "message": "Fertig" } }],
|
|
"code_blocks": [{ "execution_type": "graphql", "code": "{ vehicles { id } }" }]
|
|
}
|
|
```
|
|
|
|
### Verfuegbare Form-Widgets
|
|
|
|
`text_field` | `dropdown` | `date_time_picker` | `date_range_picker` | `checkbox` | `checkbox_group` | `radio_group` | `switch_field` | `slider` | `range_slider` | `choice_chip` | `filter_chip` | `segmented_control` | `typeahead`
|
|
|
|
### Verfuegbare Intent-Actions
|
|
|
|
| Action | Zweck |
|
|
|------------|---------------------------------------|
|
|
| `navigate` | Zu einer Route navigieren |
|
|
| `display` | Daten in einer Komponente anzeigen |
|
|
| `confirm` | Bestaetigung vor destruktiver Aktion |
|
|
| `refresh` | Aktuelle Ansicht aktualisieren |
|
|
| `notify` | Toast-Benachrichtigung |
|
|
|
|
### Code-Block-Typen
|
|
|
|
| Typ | Verwendung |
|
|
|-----------|---------------------------------------------------|
|
|
| `python` | `httpx` + `AUTH_HEADERS`, Ergebnis in `result` |
|
|
| `graphql` | Query/Mutation mit `variables` |
|
|
| `odata` | `path`, `method`, `params`, `body` |
|