@memgrafter/flatagents 0.8.0 → 0.8.1
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/package.json +14 -2
- package/schemas/README.md +11 -0
- package/schemas/flatagent.d.ts +219 -0
- package/schemas/flatagent.schema.json +271 -0
- package/schemas/flatagent.slim.d.ts +58 -0
- package/schemas/flatagents-runtime.d.ts +346 -0
- package/schemas/flatagents-runtime.schema.json +243 -0
- package/schemas/flatagents-runtime.slim.d.ts +123 -0
- package/schemas/flatmachine.d.ts +395 -0
- package/schemas/flatmachine.schema.json +596 -0
- package/schemas/flatmachine.slim.d.ts +100 -0
- package/schemas/profiles.d.ts +138 -0
- package/schemas/profiles.schema.json +90 -0
- package/schemas/profiles.slim.d.ts +25 -0
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* FlatAgents Model Profiles Schema
|
|
3
|
+
* =================================
|
|
4
|
+
*
|
|
5
|
+
* Model profiles provide reusable model configurations that agents can reference
|
|
6
|
+
* by name. This enables centralized model management and easy switching between
|
|
7
|
+
* configurations (e.g., development vs production, fast vs quality).
|
|
8
|
+
*
|
|
9
|
+
* STRUCTURE:
|
|
10
|
+
* ----------
|
|
11
|
+
* spec - Fixed string "flatprofiles"
|
|
12
|
+
* spec_version - Semver string
|
|
13
|
+
* data - Profile definitions and settings
|
|
14
|
+
* metadata - Extensibility layer
|
|
15
|
+
*
|
|
16
|
+
* DERIVED SCHEMAS:
|
|
17
|
+
* ----------------
|
|
18
|
+
* This file (/profiles.d.ts) is the SOURCE OF TRUTH for all profile schemas.
|
|
19
|
+
* Other schemas (JSON Schema, etc.) are DERIVED from this file using scripts.
|
|
20
|
+
* See: /scripts/generate-spec-assets.ts
|
|
21
|
+
*
|
|
22
|
+
* PROFILE RESOLUTION ORDER (low to high priority):
|
|
23
|
+
* ------------------------------------------------
|
|
24
|
+
* 1. default profile from profiles.yml (fallback when agent has no model config)
|
|
25
|
+
* 2. Named profile from agent's model: "profile-name"
|
|
26
|
+
* 3. Inline overrides from agent's model: { profile: "name", temperature: 0.5 }
|
|
27
|
+
* 4. override profile from profiles.yml (trumps all agent configs)
|
|
28
|
+
*
|
|
29
|
+
* AGENT USAGE:
|
|
30
|
+
* ------------
|
|
31
|
+
* String shorthand - profile lookup:
|
|
32
|
+
*
|
|
33
|
+
* data:
|
|
34
|
+
* model: "fast-cheap"
|
|
35
|
+
*
|
|
36
|
+
* Profile with overrides:
|
|
37
|
+
*
|
|
38
|
+
* data:
|
|
39
|
+
* model:
|
|
40
|
+
* profile: "fast-cheap"
|
|
41
|
+
* temperature: 0.9
|
|
42
|
+
*
|
|
43
|
+
* Inline config (no profile):
|
|
44
|
+
*
|
|
45
|
+
* data:
|
|
46
|
+
* model:
|
|
47
|
+
* provider: cerebras
|
|
48
|
+
* name: zai-glm-4.6
|
|
49
|
+
* temperature: 0.6
|
|
50
|
+
*
|
|
51
|
+
* EXAMPLE CONFIGURATION:
|
|
52
|
+
* ----------------------
|
|
53
|
+
*
|
|
54
|
+
* spec: flatprofiles
|
|
55
|
+
* spec_version: "0.7.0"
|
|
56
|
+
*
|
|
57
|
+
* data:
|
|
58
|
+
* model_profiles:
|
|
59
|
+
* fast-cheap:
|
|
60
|
+
* provider: cerebras
|
|
61
|
+
* name: zai-glm-4.6
|
|
62
|
+
* temperature: 0.6
|
|
63
|
+
* max_tokens: 2048
|
|
64
|
+
*
|
|
65
|
+
* smart-expensive:
|
|
66
|
+
* provider: anthropic
|
|
67
|
+
* name: claude-3-opus-20240229
|
|
68
|
+
* temperature: 0.3
|
|
69
|
+
* max_tokens: 4096
|
|
70
|
+
*
|
|
71
|
+
* local-dev:
|
|
72
|
+
* provider: ollama
|
|
73
|
+
* name: llama3
|
|
74
|
+
* base_url: http://localhost:11434
|
|
75
|
+
* temperature: 0.7
|
|
76
|
+
*
|
|
77
|
+
* deterministic:
|
|
78
|
+
* provider: openai
|
|
79
|
+
* name: gpt-4-turbo
|
|
80
|
+
* temperature: 0
|
|
81
|
+
* seed: 42
|
|
82
|
+
*
|
|
83
|
+
* default: fast-cheap
|
|
84
|
+
* # override: smart-expensive
|
|
85
|
+
*
|
|
86
|
+
* metadata:
|
|
87
|
+
* description: "Model profiles for the project"
|
|
88
|
+
*
|
|
89
|
+
* PROFILESDATA FIELDS:
|
|
90
|
+
* --------------------
|
|
91
|
+
* model_profiles - Named model profiles, keyed by profile name
|
|
92
|
+
* default - Default profile name, used when agent has no model config
|
|
93
|
+
* override - Override profile name, trumps all agent model configs
|
|
94
|
+
*
|
|
95
|
+
* MODELPROFILECONFIG FIELDS:
|
|
96
|
+
* --------------------------
|
|
97
|
+
* Defines all parameters for an LLM model.
|
|
98
|
+
* name - Model name (e.g., "gpt-4", "zai-glm-4.6", "claude-3-opus-20240229")
|
|
99
|
+
* provider - Provider name (e.g., "openai", "anthropic", "cerebras", "ollama")
|
|
100
|
+
* temperature - Sampling temperature (0.0 to 2.0)
|
|
101
|
+
* max_tokens - Maximum tokens to generate
|
|
102
|
+
* top_p - Nucleus sampling parameter (0.0 to 1.0)
|
|
103
|
+
* top_k - Top-k sampling parameter
|
|
104
|
+
* frequency_penalty - Frequency penalty (-2.0 to 2.0)
|
|
105
|
+
* presence_penalty - Presence penalty (-2.0 to 2.0)
|
|
106
|
+
* seed - Random seed for reproducibility
|
|
107
|
+
* base_url - Custom base URL for the API (e.g., for local models or proxies)
|
|
108
|
+
*/
|
|
109
|
+
|
|
110
|
+
export const SPEC_VERSION = "0.8.1";
|
|
111
|
+
|
|
112
|
+
export interface ProfilesWrapper {
|
|
113
|
+
spec: "flatprofiles";
|
|
114
|
+
spec_version: string;
|
|
115
|
+
data: ProfilesData;
|
|
116
|
+
metadata?: Record<string, any>;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
export interface ProfilesData {
|
|
120
|
+
model_profiles: Record<string, ModelProfileConfig>;
|
|
121
|
+
default?: string;
|
|
122
|
+
override?: string;
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
export interface ModelProfileConfig {
|
|
126
|
+
name: string;
|
|
127
|
+
provider?: string;
|
|
128
|
+
temperature?: number;
|
|
129
|
+
max_tokens?: number;
|
|
130
|
+
top_p?: number;
|
|
131
|
+
top_k?: number;
|
|
132
|
+
frequency_penalty?: number;
|
|
133
|
+
presence_penalty?: number;
|
|
134
|
+
seed?: number;
|
|
135
|
+
base_url?: string;
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
export type FlatprofilesConfig = ProfilesWrapper;
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
3
|
+
"$ref": "#/definitions/ProfilesWrapper",
|
|
4
|
+
"definitions": {
|
|
5
|
+
"ProfilesWrapper": {
|
|
6
|
+
"type": "object",
|
|
7
|
+
"properties": {
|
|
8
|
+
"spec": {
|
|
9
|
+
"type": "string",
|
|
10
|
+
"const": "flatprofiles"
|
|
11
|
+
},
|
|
12
|
+
"spec_version": {
|
|
13
|
+
"type": "string"
|
|
14
|
+
},
|
|
15
|
+
"data": {
|
|
16
|
+
"$ref": "#/definitions/ProfilesData"
|
|
17
|
+
},
|
|
18
|
+
"metadata": {
|
|
19
|
+
"type": "object"
|
|
20
|
+
}
|
|
21
|
+
},
|
|
22
|
+
"required": [
|
|
23
|
+
"spec",
|
|
24
|
+
"spec_version",
|
|
25
|
+
"data"
|
|
26
|
+
],
|
|
27
|
+
"additionalProperties": false
|
|
28
|
+
},
|
|
29
|
+
"ProfilesData": {
|
|
30
|
+
"type": "object",
|
|
31
|
+
"properties": {
|
|
32
|
+
"model_profiles": {
|
|
33
|
+
"type": "object",
|
|
34
|
+
"additionalProperties": {
|
|
35
|
+
"$ref": "#/definitions/ModelProfileConfig"
|
|
36
|
+
}
|
|
37
|
+
},
|
|
38
|
+
"default": {
|
|
39
|
+
"type": "string"
|
|
40
|
+
},
|
|
41
|
+
"override": {
|
|
42
|
+
"type": "string"
|
|
43
|
+
}
|
|
44
|
+
},
|
|
45
|
+
"required": [
|
|
46
|
+
"model_profiles"
|
|
47
|
+
],
|
|
48
|
+
"additionalProperties": false
|
|
49
|
+
},
|
|
50
|
+
"ModelProfileConfig": {
|
|
51
|
+
"type": "object",
|
|
52
|
+
"properties": {
|
|
53
|
+
"name": {
|
|
54
|
+
"type": "string"
|
|
55
|
+
},
|
|
56
|
+
"provider": {
|
|
57
|
+
"type": "string"
|
|
58
|
+
},
|
|
59
|
+
"temperature": {
|
|
60
|
+
"type": "number"
|
|
61
|
+
},
|
|
62
|
+
"max_tokens": {
|
|
63
|
+
"type": "number"
|
|
64
|
+
},
|
|
65
|
+
"top_p": {
|
|
66
|
+
"type": "number"
|
|
67
|
+
},
|
|
68
|
+
"top_k": {
|
|
69
|
+
"type": "number"
|
|
70
|
+
},
|
|
71
|
+
"frequency_penalty": {
|
|
72
|
+
"type": "number"
|
|
73
|
+
},
|
|
74
|
+
"presence_penalty": {
|
|
75
|
+
"type": "number"
|
|
76
|
+
},
|
|
77
|
+
"seed": {
|
|
78
|
+
"type": "number"
|
|
79
|
+
},
|
|
80
|
+
"base_url": {
|
|
81
|
+
"type": "string"
|
|
82
|
+
}
|
|
83
|
+
},
|
|
84
|
+
"required": [
|
|
85
|
+
"name"
|
|
86
|
+
],
|
|
87
|
+
"additionalProperties": false
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
export const SPEC_VERSION = "0.8.1";
|
|
2
|
+
export interface ProfilesWrapper {
|
|
3
|
+
spec: "flatprofiles";
|
|
4
|
+
spec_version: string;
|
|
5
|
+
data: ProfilesData;
|
|
6
|
+
metadata?: Record<string, any>;
|
|
7
|
+
}
|
|
8
|
+
export interface ProfilesData {
|
|
9
|
+
model_profiles: Record<string, ModelProfileConfig>;
|
|
10
|
+
default?: string;
|
|
11
|
+
override?: string;
|
|
12
|
+
}
|
|
13
|
+
export interface ModelProfileConfig {
|
|
14
|
+
name: string;
|
|
15
|
+
provider?: string;
|
|
16
|
+
temperature?: number;
|
|
17
|
+
max_tokens?: number;
|
|
18
|
+
top_p?: number;
|
|
19
|
+
top_k?: number;
|
|
20
|
+
frequency_penalty?: number;
|
|
21
|
+
presence_penalty?: number;
|
|
22
|
+
seed?: number;
|
|
23
|
+
base_url?: string;
|
|
24
|
+
}
|
|
25
|
+
export type FlatprofilesConfig = ProfilesWrapper;
|