@nuxtagentic/prompt 0.1.1 → 0.1.2
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
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nuxtagentic/prompt",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.2",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"files": [
|
|
6
6
|
"module.ts",
|
|
@@ -30,13 +30,13 @@
|
|
|
30
30
|
"./runtime/*": "./runtime/*.ts"
|
|
31
31
|
},
|
|
32
32
|
"dependencies": {
|
|
33
|
-
"@cloudconfig/core": "0.2.0-beta.
|
|
33
|
+
"@cloudconfig/core": "0.2.0-beta.6",
|
|
34
34
|
"@nuxt/kit": "4.6.1",
|
|
35
35
|
"@typesafe-ai/sdk": "^0.6.0",
|
|
36
36
|
"h3": "1.15.11",
|
|
37
37
|
"defu": "6.1.7",
|
|
38
|
-
"@nuxtagentic/
|
|
39
|
-
"@nuxtagentic/
|
|
38
|
+
"@nuxtagentic/data": "0.1.2",
|
|
39
|
+
"@nuxtagentic/kit": "0.1.2"
|
|
40
40
|
},
|
|
41
41
|
"peerDependencies": {
|
|
42
42
|
"nuxt": "^4.6.1"
|
|
@@ -269,12 +269,12 @@ export function createDecisionArgumentExtractor(infer: DecisionInference): Plann
|
|
|
269
269
|
}
|
|
270
270
|
const values = Object.keys(valueQuestions).length
|
|
271
271
|
? await infer({
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
272
|
+
state: {
|
|
273
|
+
...state,
|
|
274
|
+
filterShape: { counts: Object.fromEntries(counts), groups: groupCount },
|
|
275
|
+
},
|
|
276
|
+
questions: valueQuestions,
|
|
277
|
+
})
|
|
278
278
|
: shape
|
|
279
279
|
const selected = (question: string, field: string) => {
|
|
280
280
|
const key = pick(values, question)
|
|
@@ -40,14 +40,14 @@ export function useDecisionProvider(
|
|
|
40
40
|
const client =
|
|
41
41
|
id === 'typesafeAI' && apiKey
|
|
42
42
|
? new TypeSafeClient({
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
43
|
+
apiKey,
|
|
44
|
+
timeout: policy.timeoutMs,
|
|
45
|
+
retry: { maxRetries: policy.maxRetries },
|
|
46
|
+
fetch: (input, init) => {
|
|
47
|
+
onAttempt?.()
|
|
48
|
+
return globalThis.fetch(input, init)
|
|
49
|
+
},
|
|
50
|
+
})
|
|
51
51
|
: undefined
|
|
52
52
|
|
|
53
53
|
function requireKey() {
|
|
@@ -101,10 +101,10 @@ export function useDecisionProvider(
|
|
|
101
101
|
const result = client
|
|
102
102
|
? await client.systemOne(request, { signal: options.signal })
|
|
103
103
|
: readOpenAIDecisions(
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
104
|
+
await requestOpenAI(openAIDecisionBody(request, model, options.input), options.signal),
|
|
105
|
+
request,
|
|
106
|
+
model,
|
|
107
|
+
)
|
|
108
108
|
for (const [key, question] of Object.entries(request.questions)) {
|
|
109
109
|
const answer = result.answers[key]
|
|
110
110
|
if (
|
|
@@ -137,10 +137,10 @@ export function findFieldCandidates(
|
|
|
137
137
|
values = context.dates.map((candidate) =>
|
|
138
138
|
field.kind === 'date'
|
|
139
139
|
? {
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
140
|
+
...candidate,
|
|
141
|
+
value: String(candidate.value).slice(0, 10),
|
|
142
|
+
end: candidate.end?.slice(0, 10),
|
|
143
|
+
}
|
|
144
144
|
: candidate,
|
|
145
145
|
)
|
|
146
146
|
break
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
/** Closed choices, boolean flags, or literal spans copied from the prompt. */
|
|
2
2
|
export type ArgSpec =
|
|
3
3
|
| {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
4
|
+
kind: 'choice'
|
|
5
|
+
question: string
|
|
6
|
+
stated?: string
|
|
7
|
+
options: Record<string, string>
|
|
8
|
+
}
|
|
9
9
|
| { kind: 'flag'; question: string }
|
|
10
10
|
| { kind: 'span'; question: string; stated: string }
|
|
11
11
|
|
package/server-contributions.ts
CHANGED
|
@@ -23,7 +23,7 @@ export interface WorkspaceMetadata {
|
|
|
23
23
|
}
|
|
24
24
|
|
|
25
25
|
export interface AgentSession {
|
|
26
|
-
user: { id: string | number;
|
|
26
|
+
user: { id: string | number;[key: string]: unknown }
|
|
27
27
|
session: { id: string | number; activeOrganizationId?: string | number | null }
|
|
28
28
|
}
|
|
29
29
|
|