pi-provider-litellm 3.2.0 → 3.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +55 -9
- package/package.json +6 -6
- package/src/backend-identity.ts +17 -1
- package/src/discover.ts +180 -41
- package/src/index.ts +530 -150
- package/src/mcp-tools.ts +191 -9
- package/src/model-groups.ts +12 -11
- package/src/provider.ts +27 -12
- package/src/proxy-version.ts +68 -0
- package/src/skills.ts +10 -0
- package/src/types.ts +16 -0
package/src/types.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { Model } from "@earendil-works/pi-ai";
|
|
2
2
|
import type { BackendFamily, LITELLM_DISCOVERY_VERSION } from "./backend-identity.js";
|
|
3
|
+
import type { ProxyVersion } from "./proxy-version.js";
|
|
3
4
|
|
|
4
5
|
export type DiscoverySource = "model_info" | "models_list" | "health";
|
|
5
6
|
|
|
@@ -56,6 +57,9 @@ export type LiteLLMModel = Model<LiteLLMApi> & {
|
|
|
56
57
|
export interface DiscoveryResult {
|
|
57
58
|
models: DiscoveredModel[];
|
|
58
59
|
source: DiscoverySource;
|
|
60
|
+
// Present only when a `/model/info` discovery had to read it and the proxy
|
|
61
|
+
// answered. Absent means unknown, not old: discovery asks only when it must.
|
|
62
|
+
proxyVersion?: ProxyVersion;
|
|
59
63
|
}
|
|
60
64
|
|
|
61
65
|
export interface DiscoveryOptions {
|
|
@@ -138,6 +142,14 @@ export interface ResolvedCredentials {
|
|
|
138
142
|
apiKeyFromGcloudAdc?: boolean;
|
|
139
143
|
}
|
|
140
144
|
|
|
145
|
+
// The boolean MCP tool annotation hints, with the meaning Pi gives `ToolAnnotations`.
|
|
146
|
+
export interface McpToolAnnotations {
|
|
147
|
+
readOnlyHint?: boolean;
|
|
148
|
+
destructiveHint?: boolean;
|
|
149
|
+
idempotentHint?: boolean;
|
|
150
|
+
openWorldHint?: boolean;
|
|
151
|
+
}
|
|
152
|
+
|
|
141
153
|
export interface LiteLLMMcpTool {
|
|
142
154
|
name: string;
|
|
143
155
|
server_name: string;
|
|
@@ -147,6 +159,10 @@ export interface LiteLLMMcpTool {
|
|
|
147
159
|
input_schema: Record<string, unknown>;
|
|
148
160
|
// True when the proxy supplied an `inputSchema`/`input_schema` that was not a JSON object.
|
|
149
161
|
input_schema_malformed?: boolean;
|
|
162
|
+
// Boolean hints from the proxy-supplied `annotations`; every other annotation field is dropped.
|
|
163
|
+
annotations?: McpToolAnnotations;
|
|
164
|
+
// `mcp_info.description` of the server, when the proxy supplies one.
|
|
165
|
+
server_description?: string;
|
|
150
166
|
}
|
|
151
167
|
|
|
152
168
|
export interface LiteLLMSkill {
|