Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/studio-cookbook-typecheck.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@anvia/studio": patch
---

Allow Studio to accept typed pipelines with arbitrary input and output types, and update the cookbook Studio inspection example to point at the correct UI routes.
2 changes: 1 addition & 1 deletion apps/docs/content/docs/studio/configure/status.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ description: Inspect Studio runtime status, storage adapters, counts, and capabi

The Status page gives a compact operational snapshot of the local Studio runtime.

Open `http://localhost:4021/status` after starting Studio.
Open `http://localhost:4021/ui/status` after starting Studio.

## HTTP Route

Expand Down
2 changes: 1 addition & 1 deletion apps/docs/content/docs/studio/inspect-context/memory.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ description: Inspect stored Studio users, conversations, messages, and transcrip

The Memory page is backed by Studio session storage. It summarizes stored sessions by user id, lists conversations, and shows the raw messages and UI transcript steps for a selected conversation.

Open `http://localhost:4021/memory` after starting Studio.
Open `http://localhost:4021/ui/memory` after starting Studio.

## What Studio Shows

Expand Down
7 changes: 4 additions & 3 deletions examples/cookbook/09_studio/09-inspection-surfaces.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ new Studio([agent], {
},
}).start({ port: 4021 });

console.log("Open http://localhost:4021/tools to run get_ticket directly.");
console.log("Open http://localhost:4021/memory after creating a session.");
console.log("Open http://localhost:4021/status for runtime counts and capabilities.");
console.log("Open http://localhost:4021/ui/tools to run get_ticket directly.");
console.log("Open http://localhost:4021/ui/memory after creating a session.");
console.log("Open http://localhost:4021/ui/status for runtime counts and capabilities.");
console.log("Open http://localhost:4021/status for the raw status API response.");
22 changes: 21 additions & 1 deletion examples/cookbook/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,29 @@
{
"extends": "../../tsconfig.base.json",
"compilerOptions": {
"baseUrl": ".",
"noEmit": true,
"lib": ["ES2022", "DOM", "DOM.Iterable"],
"jsx": "react-jsx",
"jsxImportSource": "hono/jsx"
"jsxImportSource": "hono/jsx",
"paths": {
"@anvia/chroma": ["../../packages/vector-stores/chroma/src/index.ts"],
"@anvia/core": ["../../packages/core/src/index.ts"],
"@anvia/core/*": ["../../packages/core/src/*/index.ts"],
"@anvia/fastembed": ["../../packages/embeddings/fastembed/src/index.ts"],
"@anvia/gemini": ["../../packages/providers/gemini/src/index.ts"],
"@anvia/langfuse": ["../../packages/observability/langfuse/src/index.ts"],
"@anvia/logger": ["../../packages/logger/src/index.ts"],
"@anvia/mistral": ["../../packages/providers/mistral/src/index.ts"],
"@anvia/openai": ["../../packages/providers/openai/src/index.ts"],
"@anvia/otel": ["../../packages/observability/otel/src/index.ts"],
"@anvia/pgvector": ["../../packages/vector-stores/pgvector/src/index.ts"],
"@anvia/qdrant": ["../../packages/vector-stores/qdrant/src/index.ts"],
"@anvia/react": ["../../packages/react/src/index.ts"],
"@anvia/server": ["../../packages/server/src/index.ts"],
"@anvia/studio": ["../../packages/tools/studio/src/index.ts"],
"@anvia/transformers": ["../../packages/embeddings/transformers/src/index.ts"]
}
},
"include": [
"01_basics/**/*.ts",
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@
"cookbook:studio:06": "pnpm --filter cookbook studio:06",
"cookbook:studio:07": "pnpm --filter cookbook studio:07",
"cookbook:studio:08": "pnpm --filter cookbook studio:08",
"cookbook:studio:09": "pnpm --filter cookbook studio:09",
"cookbook:integrations": "pnpm --filter cookbook integrations",
"cookbook:integrations:01": "pnpm --filter cookbook integrations:01",
"cookbook:integrations:02": "pnpm --filter cookbook integrations:02",
Expand Down
6 changes: 4 additions & 2 deletions packages/tools/studio/src/runtime/studio.ts
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,8 @@ function studioOptionsFromTargets(
): StudioRuntimeOptions {
const agents = targets.filter((target): target is Agent => target instanceof Agent);
const pipelines = targets.filter(
(target): target is Pipeline<unknown, unknown> => target instanceof Pipeline,
// biome-ignore lint/suspicious/noExplicitAny: Studio accepts heterogeneous user pipelines.
(target): target is Pipeline<any, any> => target instanceof Pipeline,
);
return {
agents: inferStudioAgents(agents, options.quickPrompts ?? {}),
Expand All @@ -193,7 +194,8 @@ function inferStudioAgents(agents: Agent[], quickPrompts: Record<string, string[
});
}

function inferStudioPipelines(pipelines: Array<Pipeline<unknown, unknown>>): StudioPipeline[] {
// biome-ignore lint/suspicious/noExplicitAny: Studio accepts heterogeneous user pipelines.
function inferStudioPipelines(pipelines: Array<Pipeline<any, any>>): StudioPipeline[] {
const ids = new Set<string>();
return pipelines.map((pipeline) => {
const id = uniqueAgentId(pipeline.id || "pipeline", ids);
Expand Down
7 changes: 5 additions & 2 deletions packages/tools/studio/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,9 @@ export type StudioAgent = {
metadata?: JsonObject;
};

export type StudioTarget = Agent | Pipeline<unknown, unknown>;
// Studio accepts arbitrary pipelines and validates run inputs at the HTTP boundary.
// biome-ignore lint/suspicious/noExplicitAny: input/output types remain user-defined outside Studio.
export type StudioTarget = Agent | Pipeline<any, any>;

export type StudioAgentConfig = {
id: string;
Expand Down Expand Up @@ -71,7 +73,8 @@ export type StudioAgentRuntimeSummary = {

export type StudioPipeline = {
id: string;
pipeline: Pipeline<unknown, unknown>;
// biome-ignore lint/suspicious/noExplicitAny: Studio stores heterogeneous user pipelines.
pipeline: Pipeline<any, any>;
name?: string;
description?: string;
metadata?: JsonObject;
Expand Down
Loading