@anvia/studio 0.5.14 → 0.6.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/README.md +62 -0
- package/dist/index.d.ts +79 -2
- package/dist/index.js +1626 -1147
- package/dist/index.js.map +1 -1
- package/dist/ui/assets/{ArrowClockwise.es-cF7OPZy5.js → ArrowClockwise.es-BA79KX3F.js} +2 -2
- package/dist/ui/assets/{ArrowClockwise.es-cF7OPZy5.js.map → ArrowClockwise.es-BA79KX3F.js.map} +1 -1
- package/dist/ui/assets/{Path.es-D-NB-Xon.js → Path.es-DTZ3zsLn.js} +2 -2
- package/dist/ui/assets/{Path.es-D-NB-Xon.js.map → Path.es-DTZ3zsLn.js.map} +1 -1
- package/dist/ui/assets/{Play.es-BoMnJL28.js → Play.es-CJTRfv9R.js} +2 -2
- package/dist/ui/assets/{Play.es-BoMnJL28.js.map → Play.es-CJTRfv9R.js.map} +1 -1
- package/dist/ui/assets/{evals-page-Cx4Ycr-Y.js → evals-page-rS-P7eLF.js} +2 -2
- package/dist/ui/assets/{evals-page-Cx4Ycr-Y.js.map → evals-page-rS-P7eLF.js.map} +1 -1
- package/dist/ui/assets/index-B1s3oC-V.css +1 -0
- package/dist/ui/assets/index-ChlKOnbD.js +54 -0
- package/dist/ui/assets/index-ChlKOnbD.js.map +1 -0
- package/dist/ui/assets/{knowledge-page-DASnGzYP.js → knowledge-page-CR0JUneq.js} +2 -2
- package/dist/ui/assets/{knowledge-page-DASnGzYP.js.map → knowledge-page-CR0JUneq.js.map} +1 -1
- package/dist/ui/assets/{mcps-page-B7VAqsoU.js → mcps-page-D3P0UAWf.js} +2 -2
- package/dist/ui/assets/{mcps-page-B7VAqsoU.js.map → mcps-page-D3P0UAWf.js.map} +1 -1
- package/dist/ui/assets/{memory-page-BCv19Tw_.js → memory-page-kVDqOAOd.js} +2 -2
- package/dist/ui/assets/{memory-page-BCv19Tw_.js.map → memory-page-kVDqOAOd.js.map} +1 -1
- package/dist/ui/assets/{pipelines-page-Byb_JYxi.js → pipelines-page-lMfsVNRy.js} +2 -2
- package/dist/ui/assets/{pipelines-page-Byb_JYxi.js.map → pipelines-page-lMfsVNRy.js.map} +1 -1
- package/dist/ui/assets/{renderers-C8RHOlPz.js → renderers-Bc89UGTN.js} +2 -2
- package/dist/ui/assets/{renderers-C8RHOlPz.js.map → renderers-Bc89UGTN.js.map} +1 -1
- package/dist/ui/assets/{sessions-page-CV8GZKjN.js → sessions-page-CVlkRPfT.js} +2 -2
- package/dist/ui/assets/{sessions-page-CV8GZKjN.js.map → sessions-page-CVlkRPfT.js.map} +1 -1
- package/dist/ui/assets/{status-page-a6SMAcLu.js → status-page-XKvTGruQ.js} +2 -2
- package/dist/ui/assets/{status-page-a6SMAcLu.js.map → status-page-XKvTGruQ.js.map} +1 -1
- package/dist/ui/assets/{tools-page-Dpj7hI8q.js → tools-page-DJt_QdDe.js} +2 -2
- package/dist/ui/assets/{tools-page-Dpj7hI8q.js.map → tools-page-DJt_QdDe.js.map} +1 -1
- package/dist/ui/assets/{trace-browser-dvGDi7ji.js → trace-browser-BBITQELO.js} +2 -2
- package/dist/ui/assets/{trace-browser-dvGDi7ji.js.map → trace-browser-BBITQELO.js.map} +1 -1
- package/dist/ui/assets/{transcript-item-GmOQdc53.js → transcript-item-BvaA1PBu.js} +3 -3
- package/dist/ui/assets/transcript-item-BvaA1PBu.js.map +1 -0
- package/dist/ui/index.html +2 -2
- package/package.json +4 -4
- package/dist/ui/assets/index-BBfu6qlV.css +0 -1
- package/dist/ui/assets/index-rc2RWnWD.js +0 -54
- package/dist/ui/assets/index-rc2RWnWD.js.map +0 -1
- package/dist/ui/assets/transcript-item-GmOQdc53.js.map +0 -1
package/README.md
CHANGED
|
@@ -44,6 +44,68 @@ Then open:
|
|
|
44
44
|
http://localhost:4021/ui/playground
|
|
45
45
|
```
|
|
46
46
|
|
|
47
|
+
## Multi-Provider Models
|
|
48
|
+
|
|
49
|
+
Studio can expose a shared model catalog and let each agent choose from registered providers:
|
|
50
|
+
|
|
51
|
+
```ts
|
|
52
|
+
import { AgentBuilder } from "@anvia/core";
|
|
53
|
+
import { AnthropicClient } from "@anvia/anthropic";
|
|
54
|
+
import { OpenAIClient } from "@anvia/openai";
|
|
55
|
+
import { Studio } from "@anvia/studio";
|
|
56
|
+
|
|
57
|
+
const openai = new OpenAIClient({ apiKey: process.env.OPENAI_API_KEY });
|
|
58
|
+
const anthropic = new AnthropicClient({ apiKey: process.env.ANTHROPIC_API_KEY });
|
|
59
|
+
|
|
60
|
+
const agent = new AgentBuilder("support", openai.completionModel("gpt-5"))
|
|
61
|
+
.name("Support")
|
|
62
|
+
.instructions("Answer support questions clearly.")
|
|
63
|
+
.build();
|
|
64
|
+
|
|
65
|
+
new Studio([agent], {
|
|
66
|
+
models: {
|
|
67
|
+
providers: [
|
|
68
|
+
{
|
|
69
|
+
id: "openai",
|
|
70
|
+
name: "OpenAI",
|
|
71
|
+
defaultModel: "gpt-5",
|
|
72
|
+
createCompletionModel: (model) => openai.completionModel(model),
|
|
73
|
+
listModels: () => openai.listModels(),
|
|
74
|
+
models: [
|
|
75
|
+
{
|
|
76
|
+
id: "gpt-5",
|
|
77
|
+
modalities: { input: ["text", "image", "document"], output: ["text"] },
|
|
78
|
+
},
|
|
79
|
+
],
|
|
80
|
+
},
|
|
81
|
+
{
|
|
82
|
+
id: "anthropic",
|
|
83
|
+
name: "Anthropic",
|
|
84
|
+
defaultModel: "claude-sonnet-4-20250514",
|
|
85
|
+
createCompletionModel: (model) => anthropic.completionModel(model),
|
|
86
|
+
},
|
|
87
|
+
],
|
|
88
|
+
agents: {
|
|
89
|
+
support: {
|
|
90
|
+
default: "openai:gpt-5",
|
|
91
|
+
allowed: ["openai:*", "anthropic:claude-sonnet-4-20250514"],
|
|
92
|
+
},
|
|
93
|
+
},
|
|
94
|
+
},
|
|
95
|
+
}).start();
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
The playground message composer shows the allowed models for the selected agent. API callers can
|
|
99
|
+
also select a model per run:
|
|
100
|
+
|
|
101
|
+
```json
|
|
102
|
+
{
|
|
103
|
+
"message": "Summarize this ticket",
|
|
104
|
+
"model": "anthropic:claude-sonnet-4-20250514",
|
|
105
|
+
"stream": true
|
|
106
|
+
}
|
|
107
|
+
```
|
|
108
|
+
|
|
47
109
|
## Browser UI
|
|
48
110
|
|
|
49
111
|
Studio exposes:
|
package/dist/index.d.ts
CHANGED
|
@@ -1,13 +1,77 @@
|
|
|
1
1
|
import { Hono } from 'hono';
|
|
2
2
|
import { AgentTraceOptions, AgentTraceInfo, AgentObserver, AgentRunStartArgs, AgentRunObserver } from '@anvia/core/observability';
|
|
3
3
|
import { PromptResponse, AgentStreamEvent } from '@anvia/core/agent';
|
|
4
|
-
import { Message, JsonObject, JsonValue, ToolResultContent, Usage } from '@anvia/core/completion';
|
|
4
|
+
import { Message, JsonObject, JsonValue, CompletionModelCapabilities, ToolResultContent, Usage, CompletionModel, StreamingCompletionModel } from '@anvia/core/completion';
|
|
5
5
|
import { RunEvalSuiteOptions } from '@anvia/core/evals';
|
|
6
6
|
import { Agent } from '@anvia/core/internal/agent';
|
|
7
7
|
import { MemoryStore } from '@anvia/core/memory';
|
|
8
|
+
import { ModelList } from '@anvia/core/model-listing';
|
|
8
9
|
import { Pipeline, PipelineGraph } from '@anvia/core/pipeline';
|
|
9
10
|
|
|
10
11
|
type StudioCapability = "agents" | "approvals" | "evals" | "memory" | "knowledge" | "mcps" | "observability" | "pipelines" | "sessions" | "status" | "tools" | "traces";
|
|
12
|
+
type StudioModelRef = string | {
|
|
13
|
+
provider: string;
|
|
14
|
+
model: string;
|
|
15
|
+
};
|
|
16
|
+
type StudioModelModality = "text" | "image" | "document" | "audio" | "video";
|
|
17
|
+
type StudioModelModalities = {
|
|
18
|
+
input: StudioModelModality[];
|
|
19
|
+
output?: StudioModelModality[];
|
|
20
|
+
};
|
|
21
|
+
type StudioModelDefinition = {
|
|
22
|
+
id: string;
|
|
23
|
+
name?: string;
|
|
24
|
+
description?: string;
|
|
25
|
+
modalities?: StudioModelModalities;
|
|
26
|
+
capabilities?: Partial<CompletionModelCapabilities>;
|
|
27
|
+
metadata?: JsonObject;
|
|
28
|
+
};
|
|
29
|
+
type StudioModelProvider = {
|
|
30
|
+
id: string;
|
|
31
|
+
name?: string;
|
|
32
|
+
defaultModel?: string;
|
|
33
|
+
models?: StudioModelDefinition[];
|
|
34
|
+
createCompletionModel(model: string): CompletionModel | StreamingCompletionModel;
|
|
35
|
+
listModels?: () => Promise<ModelList>;
|
|
36
|
+
metadata?: JsonObject;
|
|
37
|
+
};
|
|
38
|
+
type StudioAgentModelPolicy = {
|
|
39
|
+
default?: StudioModelRef;
|
|
40
|
+
allowed?: Array<StudioModelRef | `${string}:*`>;
|
|
41
|
+
};
|
|
42
|
+
type StudioModelConfig = {
|
|
43
|
+
providers: StudioModelProvider[];
|
|
44
|
+
default?: StudioModelRef;
|
|
45
|
+
agents?: Record<string, StudioAgentModelPolicy>;
|
|
46
|
+
};
|
|
47
|
+
type StudioModelSummary = StudioModelDefinition & {
|
|
48
|
+
ref: string;
|
|
49
|
+
providerId: string;
|
|
50
|
+
providerName?: string;
|
|
51
|
+
};
|
|
52
|
+
type StudioModelProviderConfig = {
|
|
53
|
+
id: string;
|
|
54
|
+
name?: string;
|
|
55
|
+
defaultModel?: string;
|
|
56
|
+
models: StudioModelSummary[];
|
|
57
|
+
metadata?: JsonObject;
|
|
58
|
+
warning?: string;
|
|
59
|
+
};
|
|
60
|
+
type StudioAgentModelPolicyConfig = {
|
|
61
|
+
default?: string;
|
|
62
|
+
allowed?: string[];
|
|
63
|
+
};
|
|
64
|
+
type StudioModelsConfig = {
|
|
65
|
+
providers: StudioModelProviderConfig[];
|
|
66
|
+
default?: string;
|
|
67
|
+
agents: Record<string, StudioAgentModelPolicyConfig>;
|
|
68
|
+
};
|
|
69
|
+
type StudioAgentModelsSummary = {
|
|
70
|
+
agentId: string;
|
|
71
|
+
defaultModel?: string;
|
|
72
|
+
models: StudioModelSummary[];
|
|
73
|
+
warnings?: JsonObject[];
|
|
74
|
+
};
|
|
11
75
|
type StudioAgent = {
|
|
12
76
|
id: string;
|
|
13
77
|
agent: Agent;
|
|
@@ -99,6 +163,7 @@ type StudioConfig = {
|
|
|
99
163
|
description?: string;
|
|
100
164
|
version?: string;
|
|
101
165
|
agents: StudioAgentConfig[];
|
|
166
|
+
models?: StudioModelsConfig;
|
|
102
167
|
pipelines: StudioPipelineConfig[];
|
|
103
168
|
evals: StudioEvalSuiteConfig[];
|
|
104
169
|
chat: {
|
|
@@ -163,6 +228,14 @@ type StudioTranscriptChatEntry = {
|
|
|
163
228
|
text: string;
|
|
164
229
|
tone?: "error";
|
|
165
230
|
traceId?: string;
|
|
231
|
+
attachments?: StudioTranscriptAttachment[];
|
|
232
|
+
};
|
|
233
|
+
type StudioTranscriptAttachment = {
|
|
234
|
+
kind: "image" | "document";
|
|
235
|
+
name?: string;
|
|
236
|
+
mediaType?: string;
|
|
237
|
+
data?: string;
|
|
238
|
+
url?: string;
|
|
166
239
|
};
|
|
167
240
|
type StudioTranscriptReasoningEntry = {
|
|
168
241
|
entryId: number;
|
|
@@ -270,6 +343,7 @@ type StudioSessionStore = MemoryStore & {
|
|
|
270
343
|
createSession(input: StudioSessionCreateInput): StudioSessionSummary | Promise<StudioSessionSummary>;
|
|
271
344
|
getSession(id: string): StudioSession | undefined | Promise<StudioSession | undefined>;
|
|
272
345
|
saveSessionRunTranscript(input: StudioSessionRunTranscriptInput): StudioSession | undefined | Promise<StudioSession | undefined>;
|
|
346
|
+
updateSessionMetadata?(id: string, metadata: JsonObject | undefined): StudioSession | undefined | Promise<StudioSession | undefined>;
|
|
273
347
|
appendSessionLog?(input: StudioSessionLogAppendInput): StudioSessionLogEntry | Promise<StudioSessionLogEntry>;
|
|
274
348
|
listSessionLogs?(options: StudioSessionLogListOptions): StudioSessionLogEntry[] | Promise<StudioSessionLogEntry[]>;
|
|
275
349
|
deleteSession?(id: string): boolean | Promise<boolean>;
|
|
@@ -478,6 +552,7 @@ type StudioOptions = {
|
|
|
478
552
|
quickPrompts?: Record<string, string[]>;
|
|
479
553
|
stores?: StudioStores;
|
|
480
554
|
ui?: boolean | StudioUiOptions;
|
|
555
|
+
models?: StudioModelConfig;
|
|
481
556
|
};
|
|
482
557
|
type StudioServeOptions = {
|
|
483
558
|
port?: number;
|
|
@@ -670,6 +745,7 @@ type AgentRunRequest = {
|
|
|
670
745
|
stream?: boolean;
|
|
671
746
|
maxTurns?: number;
|
|
672
747
|
toolConcurrency?: number;
|
|
748
|
+
model?: StudioModelRef;
|
|
673
749
|
metadata?: JsonObject;
|
|
674
750
|
trace?: AgentTraceOptions;
|
|
675
751
|
};
|
|
@@ -683,6 +759,7 @@ type StudioErrorResponse = {
|
|
|
683
759
|
details?: JsonValue;
|
|
684
760
|
};
|
|
685
761
|
};
|
|
762
|
+
declare function traceSummary(trace: StudioTrace): StudioTraceSummary;
|
|
686
763
|
type AnviaStudio = {
|
|
687
764
|
readonly app: Hono;
|
|
688
765
|
fetch(request: Request): Response | Promise<Response>;
|
|
@@ -721,4 +798,4 @@ declare function createSqliteSessionStore(options?: SqliteSessionStoreOptions):
|
|
|
721
798
|
|
|
722
799
|
declare function createInMemoryStudioStore(): StudioSessionStore & StudioTraceStore & StudioPipelineLogStore & StudioPipelineRunStore;
|
|
723
800
|
|
|
724
|
-
export { type AgentRunRequest, type AgentRunResponse, type AgentRunStreamEvent, type AnviaStudio, type SqliteSessionStoreOptions, Studio, type StudioAgent, type StudioAgentConfig, type StudioAgentKnowledgeConfig, type StudioAgentMcpServerMetadata, type StudioAgentMcpToolMetadata, type StudioAgentMcpsSummary, type StudioAgentRuntimeSummary, type StudioAgentToolApprovalMetadata, type StudioAgentToolMetadata, type StudioAgentToolSource, type StudioAgentToolsSummary, type StudioCapability, type StudioCapabilityConfig, type StudioConfig, type StudioErrorCode, type StudioErrorResponse, type StudioEvalRunRequest, type StudioEvalRunResponse, type StudioEvalSuite, type StudioEvalSuiteConfig, type StudioKnowledgeEvidence, type StudioKnowledgeEvidenceDocument, type StudioKnowledgeItem, type StudioKnowledgeItemKind, type StudioKnowledgeItemsPage, type StudioKnowledgeSourceKind, type StudioKnowledgeSourceSummary, type StudioKnowledgeSummary, type StudioMemoryConversationMessages, type StudioMemoryConversationSteps, type StudioMemoryConversationSummary, type StudioMemoryConversationsPage, type StudioMemoryUserSummary, type StudioMemoryUsersPage, type StudioObservabilityEvent, type StudioObservabilityEventType, type StudioOptions, type StudioPipeline, type StudioPipelineConfig, type StudioPipelineDetail, type StudioPipelineFinalEvent, type StudioPipelineLogAppendInput, type StudioPipelineLogCategory, type StudioPipelineLogEntry, type StudioPipelineLogEvent, type StudioPipelineLogLevel, type StudioPipelineLogListOptions, type StudioPipelineLogStore, type StudioPipelineReplayRequest, type StudioPipelineRunGetOptions, type StudioPipelineRunListOptions, type StudioPipelineRunRecord, type StudioPipelineRunRequest, type StudioPipelineRunResponse, type StudioPipelineRunSaveInput, type StudioPipelineRunStatus, type StudioPipelineRunStore, type StudioServeOptions, type StudioSession, type StudioSessionCreateInput, type StudioSessionListOptions, type StudioSessionLogAppendInput, type StudioSessionLogCategory, type StudioSessionLogEntry, type StudioSessionLogEvent, type StudioSessionLogLevel, type StudioSessionLogListOptions, type StudioSessionRunStatus, type StudioSessionRunTranscriptInput, type StudioSessionStore, type StudioSessionSummary, type StudioSessionTraceListOptions, type StudioStaticKnowledgeDocument, type StudioStatusSummary, type StudioStores, type StudioTarget, type StudioToolApproval, type StudioToolApprovalDecision, type StudioToolApprovalRequestEvent, type StudioToolApprovalResultEvent, type StudioToolApprovalStatus, type StudioToolApprovalTranscript, type StudioToolQuestion, type StudioToolQuestionAnswer, type StudioToolQuestionChoice, type StudioToolQuestionPrompt, type StudioToolQuestionRequestEvent, type StudioToolQuestionResultEvent, type StudioToolQuestionStatus, type StudioToolQuestionTranscript, type StudioToolRunRequest, type StudioToolRunResponse, type StudioTrace, type StudioTraceListOptions, type StudioTraceObservation, type StudioTraceObservationKind, StudioTraceObserver, type StudioTraceObserverOptions, type StudioTraceStatus, type StudioTraceStore, type StudioTraceSummary, type StudioTranscriptChatEntry, type StudioTranscriptChildAgentEvent, type StudioTranscriptEntry, type StudioTranscriptReasoningEntry, type StudioTranscriptToolEntry, type StudioUiOptions, createInMemoryStudioStore, createSqliteSessionStore };
|
|
801
|
+
export { type AgentRunRequest, type AgentRunResponse, type AgentRunStreamEvent, type AnviaStudio, type SqliteSessionStoreOptions, Studio, type StudioAgent, type StudioAgentConfig, type StudioAgentKnowledgeConfig, type StudioAgentMcpServerMetadata, type StudioAgentMcpToolMetadata, type StudioAgentMcpsSummary, type StudioAgentModelPolicy, type StudioAgentModelPolicyConfig, type StudioAgentModelsSummary, type StudioAgentRuntimeSummary, type StudioAgentToolApprovalMetadata, type StudioAgentToolMetadata, type StudioAgentToolSource, type StudioAgentToolsSummary, type StudioCapability, type StudioCapabilityConfig, type StudioConfig, type StudioErrorCode, type StudioErrorResponse, type StudioEvalRunRequest, type StudioEvalRunResponse, type StudioEvalSuite, type StudioEvalSuiteConfig, type StudioKnowledgeEvidence, type StudioKnowledgeEvidenceDocument, type StudioKnowledgeItem, type StudioKnowledgeItemKind, type StudioKnowledgeItemsPage, type StudioKnowledgeSourceKind, type StudioKnowledgeSourceSummary, type StudioKnowledgeSummary, type StudioMemoryConversationMessages, type StudioMemoryConversationSteps, type StudioMemoryConversationSummary, type StudioMemoryConversationsPage, type StudioMemoryUserSummary, type StudioMemoryUsersPage, type StudioModelConfig, type StudioModelDefinition, type StudioModelModalities, type StudioModelModality, type StudioModelProvider, type StudioModelProviderConfig, type StudioModelRef, type StudioModelSummary, type StudioModelsConfig, type StudioObservabilityEvent, type StudioObservabilityEventType, type StudioOptions, type StudioPipeline, type StudioPipelineConfig, type StudioPipelineDetail, type StudioPipelineFinalEvent, type StudioPipelineLogAppendInput, type StudioPipelineLogCategory, type StudioPipelineLogEntry, type StudioPipelineLogEvent, type StudioPipelineLogLevel, type StudioPipelineLogListOptions, type StudioPipelineLogStore, type StudioPipelineReplayRequest, type StudioPipelineRunGetOptions, type StudioPipelineRunListOptions, type StudioPipelineRunRecord, type StudioPipelineRunRequest, type StudioPipelineRunResponse, type StudioPipelineRunSaveInput, type StudioPipelineRunStatus, type StudioPipelineRunStore, type StudioServeOptions, type StudioSession, type StudioSessionCreateInput, type StudioSessionListOptions, type StudioSessionLogAppendInput, type StudioSessionLogCategory, type StudioSessionLogEntry, type StudioSessionLogEvent, type StudioSessionLogLevel, type StudioSessionLogListOptions, type StudioSessionRunStatus, type StudioSessionRunTranscriptInput, type StudioSessionStore, type StudioSessionSummary, type StudioSessionTraceListOptions, type StudioStaticKnowledgeDocument, type StudioStatusSummary, type StudioStores, type StudioTarget, type StudioToolApproval, type StudioToolApprovalDecision, type StudioToolApprovalRequestEvent, type StudioToolApprovalResultEvent, type StudioToolApprovalStatus, type StudioToolApprovalTranscript, type StudioToolQuestion, type StudioToolQuestionAnswer, type StudioToolQuestionChoice, type StudioToolQuestionPrompt, type StudioToolQuestionRequestEvent, type StudioToolQuestionResultEvent, type StudioToolQuestionStatus, type StudioToolQuestionTranscript, type StudioToolRunRequest, type StudioToolRunResponse, type StudioTrace, type StudioTraceListOptions, type StudioTraceObservation, type StudioTraceObservationKind, StudioTraceObserver, type StudioTraceObserverOptions, type StudioTraceStatus, type StudioTraceStore, type StudioTraceSummary, type StudioTranscriptAttachment, type StudioTranscriptChatEntry, type StudioTranscriptChildAgentEvent, type StudioTranscriptEntry, type StudioTranscriptReasoningEntry, type StudioTranscriptToolEntry, type StudioUiOptions, createInMemoryStudioStore, createSqliteSessionStore, traceSummary };
|