Document the bundled OpenRouter configuration
This commit is contained in:
@@ -3,7 +3,7 @@
|
||||
This breaking pre-v1 minor migration adopts Promptkit's vanity module path,
|
||||
changes the v0.16-era keyed resources to identified lists, adopts ConfigKit v1,
|
||||
and removes prompt-version labels.
|
||||
Promptkit does not install a provider catalog; applications choose configuration
|
||||
Promptkit installs a default-on bundled OpenRouter catalog; applications choose configuration
|
||||
inputs explicitly, and execution selects one prompt by its exact ID. This guide
|
||||
explains the shape changes and decisions an application must make; it is not an
|
||||
automatic migration tool. The [framework format reference](../formats.md) owns
|
||||
|
||||
@@ -52,6 +52,32 @@ Create an engine with [`NewEngine`](../../engine.go). Select each directory
|
||||
explicitly and place its inputs in an ordered ConfigKit underlay. A group
|
||||
strictly composes its files; later groups can overlay earlier ones:
|
||||
|
||||
The bundled OpenRouter backend and profiles are installed in a lower underlay
|
||||
by default. Select a profile explicitly, for example:
|
||||
|
||||
```go
|
||||
input := configkit.Input{Source: configkit.Mapping("application", map[string]any{
|
||||
"prompts": []any{map[string]any{
|
||||
"id": "my-prompt",
|
||||
"messages": []any{map[string]any{"role": "user", "content": "Hello"}},
|
||||
"output": map[string]any{"format": "text", "validation_mode": "none"},
|
||||
}},
|
||||
})}
|
||||
engine, err := promptkit.NewEngine(promptkit.Config{Sources: promptkit.ConfigurationSources{Main: &input}})
|
||||
if err != nil { return err }
|
||||
result, err := engine.Run(ctx, promptkit.RunRequest{PromptID: "my-prompt", ProfileID: "gpt-luna-latest"})
|
||||
```
|
||||
|
||||
The backend looks up
|
||||
`OPENROUTER_API_KEY` when available; credentials are not required at engine
|
||||
construction. For the complete inventory and diagnostic defaults see the
|
||||
[format reference](../formats.md#bundled-openrouter-configuration). Use
|
||||
`promptkit.WithBundledOpenRouter(false)` for application-only inventories.
|
||||
Caller records replace matching bundled records in full; use `extends` with a
|
||||
distinct ID to inherit. Replacing `auto` also changes its cost-tier children's
|
||||
inherited target, while their plugins remain. External collections remain
|
||||
supported.
|
||||
|
||||
```go
|
||||
promptInputs, err := promptkit.DirectoryInputs("prompts")
|
||||
if err != nil { return err }
|
||||
@@ -665,9 +691,9 @@ the engine to pick up changed definitions or message files.
|
||||
### Choose A Profile Ownership Model
|
||||
|
||||
Supply backend and profile definitions through the configuration sources your
|
||||
application selects. PromptKit does not install provider catalogs or built-in
|
||||
profile inventories; conventional backend ID constants are names only. Define
|
||||
the model, endpoint, credentials lookup, and settings that your application
|
||||
application selects, alongside the default-on bundled OpenRouter inventory.
|
||||
Conventional backend ID constants are names only. Define or replace the model,
|
||||
endpoint, credentials lookup, and settings that your application
|
||||
intends to support. A profile may inherit a sibling profile by its local key in
|
||||
the same root or collection list; its backend reference uses the exact
|
||||
configured identity. Caller-selected source layers determine the final values. The
|
||||
|
||||
Reference in New Issue
Block a user