beddel 0.2.3 → 0.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/CHANGELOG.md +35 -0
- package/dist/agents/chat/chat.handler.d.ts +1 -1
- package/dist/agents/chat/chat.handler.d.ts.map +1 -1
- package/dist/agents/chat/chat.handler.js +9 -7
- package/dist/agents/chat/chat.handler.js.map +1 -1
- package/dist/agents/chat/chat.yaml +6 -8
- package/dist/agents/gemini-vectorize/gemini-vectorize.handler.d.ts +1 -1
- package/dist/agents/gemini-vectorize/gemini-vectorize.handler.d.ts.map +1 -1
- package/dist/agents/gemini-vectorize/gemini-vectorize.handler.js +16 -13
- package/dist/agents/gemini-vectorize/gemini-vectorize.handler.js.map +1 -1
- package/dist/agents/image/image.handler.d.ts +1 -1
- package/dist/agents/image/image.handler.d.ts.map +1 -1
- package/dist/agents/image/image.handler.js +9 -6
- package/dist/agents/image/image.handler.js.map +1 -1
- package/dist/agents/image/image.types.d.ts +1 -0
- package/dist/agents/image/image.types.d.ts.map +1 -1
- package/dist/agents/index.d.ts +11 -2
- package/dist/agents/index.d.ts.map +1 -1
- package/dist/agents/index.js +9 -3
- package/dist/agents/index.js.map +1 -1
- package/dist/agents/joker/joker.handler.d.ts +1 -1
- package/dist/agents/joker/joker.handler.d.ts.map +1 -1
- package/dist/agents/joker/joker.handler.js +7 -11
- package/dist/agents/joker/joker.handler.js.map +1 -1
- package/dist/agents/joker/joker.types.d.ts +1 -0
- package/dist/agents/joker/joker.types.d.ts.map +1 -1
- package/dist/agents/llm/index.d.ts +15 -0
- package/dist/agents/llm/index.d.ts.map +1 -0
- package/dist/agents/llm/index.js +20 -0
- package/dist/agents/llm/index.js.map +1 -0
- package/dist/agents/llm/llm.handler.d.ts +8 -0
- package/dist/agents/llm/llm.handler.d.ts.map +1 -0
- package/dist/agents/llm/llm.handler.js +64 -0
- package/dist/agents/llm/llm.handler.js.map +1 -0
- package/dist/agents/llm/llm.schema.d.ts +26 -0
- package/dist/agents/llm/llm.schema.d.ts.map +1 -0
- package/dist/agents/llm/llm.schema.js +23 -0
- package/dist/agents/llm/llm.schema.js.map +1 -0
- package/dist/agents/llm/llm.types.d.ts +34 -0
- package/dist/agents/llm/llm.types.d.ts.map +1 -0
- package/dist/agents/llm/llm.types.js +7 -0
- package/dist/agents/llm/llm.types.js.map +1 -0
- package/dist/agents/llm/llm.yaml +87 -0
- package/dist/agents/rag/rag.handler.d.ts +1 -0
- package/dist/agents/rag/rag.handler.d.ts.map +1 -1
- package/dist/agents/rag/rag.handler.js +15 -38
- package/dist/agents/rag/rag.handler.js.map +1 -1
- package/dist/agents/rag/rag.types.d.ts +2 -7
- package/dist/agents/rag/rag.types.d.ts.map +1 -1
- package/dist/agents/rag/rag.types.js +1 -0
- package/dist/agents/rag/rag.types.js.map +1 -1
- package/dist/agents/registry/agentRegistry.d.ts +5 -0
- package/dist/agents/registry/agentRegistry.d.ts.map +1 -1
- package/dist/agents/registry/agentRegistry.js +33 -1
- package/dist/agents/registry/agentRegistry.js.map +1 -1
- package/dist/agents/translator/translator.handler.d.ts +1 -1
- package/dist/agents/translator/translator.handler.d.ts.map +1 -1
- package/dist/agents/translator/translator.handler.js +11 -13
- package/dist/agents/translator/translator.handler.js.map +1 -1
- package/dist/agents/translator/translator.types.d.ts +1 -0
- package/dist/agents/translator/translator.types.d.ts.map +1 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -1
- package/dist/index.js.map +1 -1
- package/dist/runtime/declarativeAgentRuntime.d.ts +4 -4
- package/dist/runtime/declarativeAgentRuntime.d.ts.map +1 -1
- package/dist/runtime/declarativeAgentRuntime.js +14 -9
- package/dist/runtime/declarativeAgentRuntime.js.map +1 -1
- package/dist/runtime/index.d.ts +3 -1
- package/dist/runtime/index.d.ts.map +1 -1
- package/dist/runtime/index.js +6 -1
- package/dist/runtime/index.js.map +1 -1
- package/dist/runtime/llmProviderFactory.d.ts +47 -0
- package/dist/runtime/llmProviderFactory.d.ts.map +1 -0
- package/dist/runtime/llmProviderFactory.js +119 -0
- package/dist/runtime/llmProviderFactory.js.map +1 -0
- package/dist/runtime/workflowExecutor.d.ts +3 -2
- package/dist/runtime/workflowExecutor.d.ts.map +1 -1
- package/dist/runtime/workflowExecutor.js +21 -11
- package/dist/runtime/workflowExecutor.js.map +1 -1
- package/dist/shared/types/agent.types.d.ts +15 -2
- package/dist/shared/types/agent.types.d.ts.map +1 -1
- package/dist/shared/types/agent.types.js +11 -0
- package/dist/shared/types/agent.types.js.map +1 -1
- package/package.json +7 -5
- package/src/agents/chat/chat.handler.ts +15 -13
- package/src/agents/chat/chat.yaml +6 -8
- package/src/agents/gemini-vectorize/gemini-vectorize.handler.ts +18 -15
- package/src/agents/image/image.handler.ts +10 -6
- package/src/agents/image/image.types.ts +1 -0
- package/src/agents/index.ts +6 -2
- package/src/agents/joker/joker.handler.ts +7 -12
- package/src/agents/joker/joker.types.ts +1 -0
- package/src/agents/llm/index.ts +20 -0
- package/src/agents/llm/llm.handler.ts +82 -0
- package/src/agents/llm/llm.schema.ts +25 -0
- package/src/agents/llm/llm.types.ts +37 -0
- package/src/agents/llm/llm.yaml +87 -0
- package/src/agents/rag/rag.handler.ts +20 -44
- package/src/agents/rag/rag.types.ts +2 -8
- package/src/agents/registry/agentRegistry.ts +34 -1
- package/src/agents/translator/translator.handler.ts +11 -13
- package/src/agents/translator/translator.types.ts +1 -0
- package/src/index.ts +8 -0
- package/src/runtime/declarativeAgentRuntime.ts +14 -9
- package/src/runtime/index.ts +5 -0
- package/src/runtime/llmProviderFactory.ts +145 -0
- package/src/runtime/workflowExecutor.ts +23 -10
- package/src/shared/types/agent.types.ts +23 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,40 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [0.3.0] - 2025-12-22
|
|
4
|
+
|
|
5
|
+
### Added
|
|
6
|
+
- **New LLM Agent**: Direct LLM interaction without document context
|
|
7
|
+
- `llm.execute` method for simple chat with conversation history
|
|
8
|
+
- `llm` workflow step type for declarative workflows
|
|
9
|
+
- Full TypeScript types: `LlmHandlerParams`, `LlmHandlerResult`, `LlmMetadata`
|
|
10
|
+
- Zod schemas: `LlmInputSchema`, `LlmOutputSchema`
|
|
11
|
+
|
|
12
|
+
### Changed
|
|
13
|
+
- **Refactored Agent Architecture**: Fixed responsibility leak between chat and rag agents
|
|
14
|
+
- RAG agent now ALWAYS requires document context (removed `mode` parameter)
|
|
15
|
+
- Chat agent uses LLM agent for `mode='simple'` (previously used RAG with mode)
|
|
16
|
+
- Clear separation: LLM = direct chat, RAG = document-augmented generation
|
|
17
|
+
- **Updated Documentation**:
|
|
18
|
+
- Added GraphQL API Integration section with complete examples
|
|
19
|
+
- Updated agent architecture diagram
|
|
20
|
+
- Added LLM agent to built-in agents catalog
|
|
21
|
+
- Updated workflow step types table
|
|
22
|
+
|
|
23
|
+
### Removed
|
|
24
|
+
- `RagMode` type from RAG agent (was semantically incorrect)
|
|
25
|
+
- `buildSimpleChatPrompt` function from RAG handler (moved to LLM agent)
|
|
26
|
+
- `mode` parameter from RAG agent (RAG always requires documents)
|
|
27
|
+
|
|
28
|
+
### Migration Guide
|
|
29
|
+
If you were using `rag.execute` with `mode: 'simple'`:
|
|
30
|
+
```typescript
|
|
31
|
+
// Before (v0.2.x)
|
|
32
|
+
await executeRagHandler({ query, history, mode: 'simple' }, props, context);
|
|
33
|
+
|
|
34
|
+
// After (v0.3.0)
|
|
35
|
+
await executeLlmHandler({ query, history }, props, context);
|
|
36
|
+
```
|
|
37
|
+
|
|
3
38
|
## [0.2.3] - 2025-12-20
|
|
4
39
|
|
|
5
40
|
### Added
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import 'server-only';
|
|
2
2
|
/**
|
|
3
3
|
* Chat Agent Handler - Server-only execution logic
|
|
4
|
-
* Orchestrates RAG pipeline or simple chat based on mode
|
|
4
|
+
* Orchestrates RAG pipeline or simple LLM chat based on mode
|
|
5
5
|
*/
|
|
6
6
|
import type { ExecutionContext } from '../../types/executionContext';
|
|
7
7
|
import type { ChatHandlerParams, ChatHandlerResult } from './chat.types';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chat.handler.d.ts","sourceRoot":"","sources":["../../../src/agents/chat/chat.handler.ts"],"names":[],"mappings":"AAAA,OAAO,aAAa,CAAC;AAErB;;;GAGG;AAEH,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAC;AAErE,OAAO,KAAK,EAAE,iBAAiB,EAAE,iBAAiB,EAAY,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"chat.handler.d.ts","sourceRoot":"","sources":["../../../src/agents/chat/chat.handler.ts"],"names":[],"mappings":"AAAA,OAAO,aAAa,CAAC;AAErB;;;GAGG;AAEH,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAC;AAErE,OAAO,KAAK,EAAE,iBAAiB,EAAE,iBAAiB,EAAY,MAAM,cAAc,CAAC;AAuKnF;;GAEG;AACH,wBAAsB,kBAAkB,CACtC,MAAM,EAAE,iBAAiB,EACzB,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,EAC7B,OAAO,EAAE,gBAAgB,GACxB,OAAO,CAAC,iBAAiB,CAAC,CA2B5B"}
|
|
@@ -5,22 +5,23 @@ require("server-only");
|
|
|
5
5
|
const gemini_vectorize_handler_1 = require("../gemini-vectorize/gemini-vectorize.handler");
|
|
6
6
|
const chromadb_handler_1 = require("../chromadb/chromadb.handler");
|
|
7
7
|
const rag_handler_1 = require("../rag/rag.handler");
|
|
8
|
+
const llm_handler_1 = require("../llm/llm.handler");
|
|
8
9
|
const KNOWLEDGE_COLLECTION = 'beddel_knowledge';
|
|
9
10
|
/**
|
|
10
|
-
* Execute simple chat mode - direct LLM with conversation history
|
|
11
|
+
* Execute simple chat mode - direct LLM with conversation history (no documents)
|
|
11
12
|
*/
|
|
12
13
|
async function executeSimpleChat(query, messages, props, context, executionSteps) {
|
|
13
14
|
const startTime = Date.now();
|
|
14
15
|
context.log(`[Chat:Simple] Processing query: "${query.substring(0, 50)}..."`);
|
|
15
16
|
const chatStep = {
|
|
16
|
-
agent: '
|
|
17
|
+
agent: 'llm',
|
|
17
18
|
action: 'chat',
|
|
18
19
|
status: 'running',
|
|
19
20
|
startTime: Date.now(),
|
|
20
21
|
phase: 'generation',
|
|
21
22
|
};
|
|
22
23
|
executionSteps.push(chatStep);
|
|
23
|
-
const result = await (0,
|
|
24
|
+
const result = await (0, llm_handler_1.executeLlmHandler)({ query, history: messages }, props, context);
|
|
24
25
|
chatStep.status = result.error ? 'error' : 'success';
|
|
25
26
|
chatStep.endTime = Date.now();
|
|
26
27
|
chatStep.duration = chatStep.endTime - chatStep.startTime;
|
|
@@ -86,7 +87,7 @@ async function executeRagChat(query, messages, props, context, executionSteps) {
|
|
|
86
87
|
searchStep.status = searchResult.success ? 'success' : 'error';
|
|
87
88
|
searchStep.endTime = Date.now();
|
|
88
89
|
searchStep.duration = searchStep.endTime - searchStep.startTime;
|
|
89
|
-
// Step 4: Generate answer
|
|
90
|
+
// Step 4: Generate answer using RAG
|
|
90
91
|
const ragStep = {
|
|
91
92
|
agent: 'rag',
|
|
92
93
|
action: 'generate',
|
|
@@ -96,9 +97,10 @@ async function executeRagChat(query, messages, props, context, executionSteps) {
|
|
|
96
97
|
};
|
|
97
98
|
executionSteps.push(ragStep);
|
|
98
99
|
const hasDocuments = searchResult.documents && searchResult.documents.trim().length > 0;
|
|
99
|
-
const
|
|
100
|
-
?
|
|
101
|
-
:
|
|
100
|
+
const documents = hasDocuments
|
|
101
|
+
? searchResult.documents
|
|
102
|
+
: 'No specific documentation available. Answer based on general knowledge.';
|
|
103
|
+
const ragResult = await (0, rag_handler_1.executeRagHandler)({ query, documents, history: messages }, props, context);
|
|
102
104
|
ragStep.status = ragResult.error ? 'error' : 'success';
|
|
103
105
|
ragStep.endTime = Date.now();
|
|
104
106
|
ragStep.duration = ragStep.endTime - ragStep.startTime;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chat.handler.js","sourceRoot":"","sources":["../../../src/agents/chat/chat.handler.ts"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"chat.handler.js","sourceRoot":"","sources":["../../../src/agents/chat/chat.handler.ts"],"names":[],"mappings":";;AAmLA,gDA+BC;AAlND,uBAAqB;AAUrB,2FAAuF;AACvF,mEAAsE;AACtE,oDAAuD;AACvD,oDAAuD;AAEvD,MAAM,oBAAoB,GAAG,kBAAkB,CAAC;AAEhD;;GAEG;AACH,KAAK,UAAU,iBAAiB,CAC9B,KAAa,EACb,QAAuC,EACvC,KAA6B,EAC7B,OAAyB,EACzB,cAA+B;IAE/B,MAAM,SAAS,GAAG,IAAI,CAAC,GAAG,EAAE,CAAC;IAE7B,OAAO,CAAC,GAAG,CAAC,oCAAoC,KAAK,CAAC,SAAS,CAAC,CAAC,EAAE,EAAE,CAAC,MAAM,CAAC,CAAC;IAE9E,MAAM,QAAQ,GAAkB;QAC9B,KAAK,EAAE,KAAK;QACZ,MAAM,EAAE,MAAM;QACd,MAAM,EAAE,SAAS;QACjB,SAAS,EAAE,IAAI,CAAC,GAAG,EAAE;QACrB,KAAK,EAAE,YAAY;KACpB,CAAC;IACF,cAAc,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;IAE9B,MAAM,MAAM,GAAG,MAAM,IAAA,+BAAiB,EACpC,EAAE,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAE,EAC5B,KAAK,EACL,OAAO,CACR,CAAC;IAEF,QAAQ,CAAC,MAAM,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,SAAS,CAAC;IACrD,QAAQ,CAAC,OAAO,GAAG,IAAI,CAAC,GAAG,EAAE,CAAC;IAC9B,QAAQ,CAAC,QAAQ,GAAG,QAAQ,CAAC,OA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QAE1B,OAAO;YACL,QAAQ,EAAE,kCAAkC,OAAO,EAAE;YACrD,SAAS,EAAE,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE;YACnC,eAAe,EAAE,cAAc;YAC/B,cAAc,EAAE,CAAC;SAClB,CAAC;IACJ,CAAC;AACH,CAAC"}
|
|
@@ -9,7 +9,7 @@ agent:
|
|
|
9
9
|
|
|
10
10
|
metadata:
|
|
11
11
|
name: "Q&A Context Chat Agent"
|
|
12
|
-
description: "Orchestrates RAG pipeline or
|
|
12
|
+
description: "Orchestrates RAG pipeline or direct LLM chat based on mode selection"
|
|
13
13
|
category: "chat"
|
|
14
14
|
route: "/agents/chat"
|
|
15
15
|
knowledge_sources:
|
|
@@ -18,8 +18,8 @@ metadata:
|
|
|
18
18
|
- "chat"
|
|
19
19
|
- "orchestrator"
|
|
20
20
|
- "rag"
|
|
21
|
+
- "llm"
|
|
21
22
|
- "qa"
|
|
22
|
-
- "simple"
|
|
23
23
|
|
|
24
24
|
schema:
|
|
25
25
|
input:
|
|
@@ -87,19 +87,18 @@ logic:
|
|
|
87
87
|
output:
|
|
88
88
|
_extracted: true
|
|
89
89
|
|
|
90
|
-
# Step 2: Mode branch - Simple chat or RAG pipeline
|
|
90
|
+
# Step 2: Mode branch - Simple LLM chat or RAG pipeline
|
|
91
91
|
- name: "mode-check"
|
|
92
92
|
type: "conditional"
|
|
93
93
|
condition: "$input.mode == 'simple'"
|
|
94
94
|
then:
|
|
95
|
-
# Simple mode: Direct LLM chat with conversation history
|
|
95
|
+
# Simple mode: Direct LLM chat with conversation history (no documents)
|
|
96
96
|
- name: "simple-chat"
|
|
97
|
-
type: "
|
|
97
|
+
type: "llm"
|
|
98
98
|
action:
|
|
99
99
|
query: "$input.query"
|
|
100
100
|
history: "$input.messages"
|
|
101
|
-
|
|
102
|
-
result: "ragResult"
|
|
101
|
+
result: "llmResult"
|
|
103
102
|
else:
|
|
104
103
|
# RAG mode: Full pipeline with knowledge base
|
|
105
104
|
- name: "vectorize-query"
|
|
@@ -132,7 +131,6 @@ logic:
|
|
|
132
131
|
query: "$input.query"
|
|
133
132
|
documents: "$searchResult.documents"
|
|
134
133
|
history: "$input.messages"
|
|
135
|
-
mode: "rag"
|
|
136
134
|
result: "ragResult"
|
|
137
135
|
|
|
138
136
|
# Step 3: Deliver final response
|
|
@@ -2,7 +2,7 @@ import 'server-only';
|
|
|
2
2
|
import type { ExecutionContext } from '../../types/executionContext';
|
|
3
3
|
import type { VectorizeHandlerParams, VectorizeHandlerResult } from './gemini-vectorize.types';
|
|
4
4
|
/**
|
|
5
|
-
* Execute vectorization using
|
|
5
|
+
* Execute vectorization using embeddings
|
|
6
6
|
*/
|
|
7
7
|
export declare function executeVectorizeHandler(params: VectorizeHandlerParams, props: Record<string, string>, context: ExecutionContext): Promise<VectorizeHandlerResult>;
|
|
8
8
|
//# sourceMappingURL=gemini-vectorize.handler.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"gemini-vectorize.handler.d.ts","sourceRoot":"","sources":["../../../src/agents/gemini-vectorize/gemini-vectorize.handler.ts"],"names":[],"mappings":"AAAA,OAAO,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"gemini-vectorize.handler.d.ts","sourceRoot":"","sources":["../../../src/agents/gemini-vectorize/gemini-vectorize.handler.ts"],"names":[],"mappings":"AAAA,OAAO,aAAa,CAAC;AAYrB,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAC;AACrE,OAAO,KAAK,EAAE,sBAAsB,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AAI/F;;GAEG;AACH,wBAAsB,uBAAuB,CAC3C,MAAM,EAAE,sBAAsB,EAC9B,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,EAC7B,OAAO,EAAE,gBAAgB,GACxB,OAAO,CAAC,sBAAsB,CAAC,CAkDjC"}
|
|
@@ -4,21 +4,24 @@ exports.executeVectorizeHandler = executeVectorizeHandler;
|
|
|
4
4
|
require("server-only");
|
|
5
5
|
/**
|
|
6
6
|
* Gemini Vectorize Agent Handler - Server-only execution logic
|
|
7
|
-
* Generates text embeddings using Google's
|
|
7
|
+
* Generates text embeddings using Google's text-embedding-004 model
|
|
8
|
+
*
|
|
9
|
+
* Note: Embeddings currently only support Google provider via Vercel AI SDK
|
|
8
10
|
*/
|
|
9
11
|
const ai_1 = require("ai");
|
|
10
12
|
const google_1 = require("@ai-sdk/google");
|
|
11
|
-
const
|
|
13
|
+
const llmProviderFactory_1 = require("../../runtime/llmProviderFactory");
|
|
14
|
+
const EMBEDDING_MODEL = 'text-embedding-004';
|
|
12
15
|
/**
|
|
13
|
-
* Execute vectorization using
|
|
16
|
+
* Execute vectorization using embeddings
|
|
14
17
|
*/
|
|
15
18
|
async function executeVectorizeHandler(params, props, context) {
|
|
16
|
-
const
|
|
17
|
-
|
|
18
|
-
|
|
19
|
+
const providerConfig = (0, llmProviderFactory_1.extractProviderConfig)(props, 'google');
|
|
20
|
+
// Currently only Google supports embeddings via Vercel AI SDK
|
|
21
|
+
if (providerConfig.provider !== 'google') {
|
|
22
|
+
throw new Error(`Embeddings are currently only supported with Google provider, got: ${providerConfig.provider}`);
|
|
19
23
|
}
|
|
20
|
-
|
|
21
|
-
process.env.GOOGLE_GENERATIVE_AI_API_KEY = apiKey;
|
|
24
|
+
const google = (0, google_1.createGoogleGenerativeAI)({ apiKey: providerConfig.apiKey });
|
|
22
25
|
const action = params.action || 'embedSingle';
|
|
23
26
|
try {
|
|
24
27
|
if (action === 'embedSingle') {
|
|
@@ -26,9 +29,9 @@ async function executeVectorizeHandler(params, props, context) {
|
|
|
26
29
|
if (!text) {
|
|
27
30
|
throw new Error('Text input is required for embedSingle');
|
|
28
31
|
}
|
|
29
|
-
context.log(`[
|
|
32
|
+
context.log(`[Vectorize] Embedding single text (${text.length} chars)...`);
|
|
30
33
|
const { embedding } = await (0, ai_1.embed)({
|
|
31
|
-
model:
|
|
34
|
+
model: google.textEmbeddingModel(EMBEDDING_MODEL),
|
|
32
35
|
value: text,
|
|
33
36
|
});
|
|
34
37
|
return { success: true, vector: embedding };
|
|
@@ -38,9 +41,9 @@ async function executeVectorizeHandler(params, props, context) {
|
|
|
38
41
|
if (!texts || !Array.isArray(texts)) {
|
|
39
42
|
throw new Error('Texts array input is required for embedBatch');
|
|
40
43
|
}
|
|
41
|
-
context.log(`[
|
|
44
|
+
context.log(`[Vectorize] Embedding batch of ${texts.length} texts...`);
|
|
42
45
|
const { embeddings } = await (0, ai_1.embedMany)({
|
|
43
|
-
model:
|
|
46
|
+
model: google.textEmbeddingModel(EMBEDDING_MODEL),
|
|
44
47
|
values: texts,
|
|
45
48
|
});
|
|
46
49
|
return { success: true, vectors: embeddings };
|
|
@@ -51,7 +54,7 @@ async function executeVectorizeHandler(params, props, context) {
|
|
|
51
54
|
}
|
|
52
55
|
catch (error) {
|
|
53
56
|
const message = error instanceof Error ? error.message : String(error);
|
|
54
|
-
context.log(`[
|
|
57
|
+
context.log(`[Vectorize] Error: ${message}`);
|
|
55
58
|
return { success: false, error: message };
|
|
56
59
|
}
|
|
57
60
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"gemini-vectorize.handler.js","sourceRoot":"","sources":["../../../src/agents/gemini-vectorize/gemini-vectorize.handler.ts"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"gemini-vectorize.handler.js","sourceRoot":"","sources":["../../../src/agents/gemini-vectorize/gemini-vectorize.handler.ts"],"names":[],"mappings":";;AAoBA,0DAsDC;AA1ED,uBAAqB;AAErB;;;;;GAKG;AAEH,2BAAsC;AACtC,2CAA0D;AAC1D,yEAAyE;AAIzE,MAAM,eAAe,GAAG,oBAAoB,CAAC;AAE7C;;GAEG;AACI,KAAK,UAAU,uBAAuB,CAC3C,MAA8B,EAC9B,KAA6B,EAC7B,OAAyB;IAEzB,MAAM,cAAc,GAAG,IAAA,0CAAqB,EAAC,KAAK,EAAE,QAAQ,CA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C;gBACrC,KAAK,EAAE,MAAM,CAAC,kBAAkB,CAAC,eAAe,CAAC;gBACjD,MAAM,EAAE,KAAK;aACd,CAAC,CAAC;YAEH,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,UAAU,EAAE,CAAC;QAEhD,CAAC;aAAM,CAAC;YACN,MAAM,IAAI,KAAK,CAAC,6BAA6B,MAAM,EAAE,CAAC,CAAC;QACzD,CAAC;IACH,CAAC;IAAC,OAAO,KAAc,EAAE,CAAC;QACxB,MAAM,OAAO,GAAG,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;QACvE,OAAO,CAAC,GAAG,CAAC,sBAAsB,OAAO,EAAE,CAAC,CAAC;QAC7C,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,OAAO,EAAE,CAAC;IAC5C,CAAC;AACH,CAAC"}
|
|
@@ -2,7 +2,7 @@ import 'server-only';
|
|
|
2
2
|
import type { ExecutionContext } from '../../types/executionContext';
|
|
3
3
|
import type { ImageHandlerParams, ImageHandlerResult } from './image.types';
|
|
4
4
|
/**
|
|
5
|
-
* Execute image generation using
|
|
5
|
+
* Execute image generation using configured provider
|
|
6
6
|
*/
|
|
7
7
|
export declare function executeImageHandler(params: ImageHandlerParams, props: Record<string, string>, context: ExecutionContext): Promise<ImageHandlerResult>;
|
|
8
8
|
//# sourceMappingURL=image.handler.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"image.handler.d.ts","sourceRoot":"","sources":["../../../src/agents/image/image.handler.ts"],"names":[],"mappings":"AAAA,OAAO,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"image.handler.d.ts","sourceRoot":"","sources":["../../../src/agents/image/image.handler.ts"],"names":[],"mappings":"AAAA,OAAO,aAAa,CAAC;AAUrB,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAC;AACrE,OAAO,KAAK,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAC;AAI5E;;GAEG;AACH,wBAAsB,mBAAmB,CACvC,MAAM,EAAE,kBAAkB,EAC1B,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,EAC7B,OAAO,EAAE,gBAAgB,GACxB,OAAO,CAAC,kBAAkB,CAAC,CA+D7B"}
|
|
@@ -4,18 +4,20 @@ exports.executeImageHandler = executeImageHandler;
|
|
|
4
4
|
require("server-only");
|
|
5
5
|
/**
|
|
6
6
|
* Image Agent Handler - Server-only execution logic
|
|
7
|
-
* Generates images using Gemini
|
|
7
|
+
* Generates images using LLM providers (Google Gemini Imagen by default)
|
|
8
8
|
*/
|
|
9
9
|
const ai_1 = require("ai");
|
|
10
10
|
const google_1 = require("@ai-sdk/google");
|
|
11
|
+
const llmProviderFactory_1 = require("../../runtime/llmProviderFactory");
|
|
11
12
|
const GEMINI_IMAGE_MODEL = 'imagen-4.0-fast-generate-001';
|
|
12
13
|
/**
|
|
13
|
-
* Execute image generation using
|
|
14
|
+
* Execute image generation using configured provider
|
|
14
15
|
*/
|
|
15
16
|
async function executeImageHandler(params, props, context) {
|
|
16
|
-
const
|
|
17
|
-
|
|
18
|
-
|
|
17
|
+
const providerConfig = (0, llmProviderFactory_1.extractProviderConfig)(props, 'google');
|
|
18
|
+
// Currently only Google supports image generation via Vercel AI SDK
|
|
19
|
+
if (providerConfig.provider !== 'google') {
|
|
20
|
+
throw new Error(`Image generation is currently only supported with Google provider, got: ${providerConfig.provider}`);
|
|
19
21
|
}
|
|
20
22
|
const description = params.description?.trim();
|
|
21
23
|
const style = params.style?.trim();
|
|
@@ -35,7 +37,7 @@ async function executeImageHandler(params, props, context) {
|
|
|
35
37
|
.replace(/{{description}}/g, description)
|
|
36
38
|
.replace(/{{style}}/g, style)
|
|
37
39
|
.trim();
|
|
38
|
-
const google = (0, google_1.createGoogleGenerativeAI)({ apiKey });
|
|
40
|
+
const google = (0, google_1.createGoogleGenerativeAI)({ apiKey: providerConfig.apiKey });
|
|
39
41
|
const model = google.image(GEMINI_IMAGE_MODEL);
|
|
40
42
|
const startTime = Date.now();
|
|
41
43
|
context.log(`[Image] Generating image with style=${style}, resolution=${resolution}`);
|
|
@@ -57,6 +59,7 @@ async function executeImageHandler(params, props, context) {
|
|
|
57
59
|
prompt_used: prompt,
|
|
58
60
|
metadata: {
|
|
59
61
|
model_used: GEMINI_IMAGE_MODEL,
|
|
62
|
+
provider: providerConfig.provider,
|
|
60
63
|
processing_time: Date.now() - startTime,
|
|
61
64
|
style,
|
|
62
65
|
resolution,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"image.handler.js","sourceRoot":"","sources":["../../../src/agents/image/image.handler.ts"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"image.handler.js","sourceRoot":"","sources":["../../../src/agents/image/image.handler.ts"],"names":[],"mappings":";;AAkBA,kDAmEC;AArFD,uBAAqB;AAErB;;;GAGG;AAEH,2BAAgD;AAChD,2CAA0D;AAC1D,yEAAyE;AAIzE,MAAM,kBAAkB,GAAG,8BAA8B,CAAC;AAE1D;;GAEG;AACI,KAAK,UAAU,mBAAmB,CACvC,MAA0B,EAC1B,KAA6B,EAC7B,OAAyB;IAEzB,MAAM,cAAc,GAAG,IAAA,0CAAqB,EAAC,KAAK,EAAE,QAAQ,CAAC,CAAC;IAE9D,oEAAoE;IACpE,IAAI,cAAc,CAAC,QAAQ,KAAK,QAAQ,EAAE,CAAC;QACzC,MAAM,IAAI,KAAK,CAAC,2EAA2E,cAAc,CAAC,QAAQ,EAAE,CAAC,CAAC;IACxH,CAAC;IAED,MAAM,WAAW,GAAG,MAAM,CAAC,WAAW,EAAE,IAAI,EAAE,CAAC;IAC/C,MAAM,KAAK,GAAG,MAAM,CAAC,KAAK,EAAE,IAAI,EAAE,CAAC;IACnC,MAAM,UAAU,GAAG,MAAM,CAAC,UAAU,EAAE,IAAI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CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,UAAU,CAAC;IACrB,KAAK,EAAE,eAAe,CAAC;CACxB"}
|
|
1
|
+
{"version":3,"file":"image.types.d.ts","sourceRoot":"","sources":["../../../src/agents/image/image.types.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH;;GAEG;AACH,MAAM,MAAM,UAAU,GAAG,YAAY,GAAG,MAAM,GAAG,QAAQ,GAAG,MAAM,CAAC;AAEnE;;GAEG;AACH,MAAM,WAAW,kBAAkB;IACjC,WAAW,EAAE,MAAM,CAAC;IACpB,KAAK,EAAE,UAAU,CAAC;IAClB,UAAU,EAAE,MAAM,CAAC;IACnB,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB;AAED;;GAEG;AACH,MAAM,WAAW,kBAAkB;IACjC,SAAS,EAAE,MAAM,CAAC;IAClB,YAAY,EAAE,MAAM,CAAC;IACrB,UAAU,EAAE,MAAM,CAAC;IACnB,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE;QACR,UAAU,EAAE,MAAM,CAAC;QACnB,QAAQ,EAAE,MAAM,CAAC;QACjB,eAAe,EAAE,MAAM,CAAC;QACxB,KAAK,EAAE,MAAM,CAAC;QACd,UAAU,EAAE,MAAM,CAAC;KACpB,CAAC;CACH;AAED;;GAEG;AACH,MAAM,WAAW,aAAa;IAC5B,EAAE,EAAE,OAAO,CAAC;IACZ,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,UAAU,CAAC;IACrB,KAAK,EAAE,eAAe,CAAC;CACxB"}
|
package/dist/agents/index.d.ts
CHANGED
|
@@ -15,6 +15,7 @@ export { geminiVectorizeMetadata } from './gemini-vectorize';
|
|
|
15
15
|
export { chromadbMetadata } from './chromadb';
|
|
16
16
|
export { gitmcpMetadata } from './gitmcp';
|
|
17
17
|
export { ragMetadata } from './rag';
|
|
18
|
+
export { llmMetadata } from './llm';
|
|
18
19
|
export { chatMetadata } from './chat';
|
|
19
20
|
export { JokerInputSchema, JokerOutputSchema } from './joker';
|
|
20
21
|
export { TranslatorInputSchema, TranslatorOutputSchema } from './translator';
|
|
@@ -24,6 +25,7 @@ export { GeminiVectorizeInputSchema, GeminiVectorizeOutputSchema } from './gemin
|
|
|
24
25
|
export { ChromaDBInputSchema, ChromaDBOutputSchema } from './chromadb';
|
|
25
26
|
export { GitMcpInputSchema, GitMcpOutputSchema } from './gitmcp';
|
|
26
27
|
export { RagInputSchema, RagOutputSchema } from './rag';
|
|
28
|
+
export { LlmInputSchema, LlmOutputSchema } from './llm';
|
|
27
29
|
export { ChatInputSchema, ChatOutputSchema } from './chat';
|
|
28
30
|
export type { JokerInput, JokerOutput, JokeHandlerParams, JokeHandlerResult } from './joker';
|
|
29
31
|
export type { TranslatorInput, TranslatorOutput, TranslationHandlerParams, TranslationHandlerResult } from './translator';
|
|
@@ -33,6 +35,7 @@ export type { GeminiVectorizeInput, GeminiVectorizeOutput, VectorizeHandlerParam
|
|
|
33
35
|
export type { ChromaDBInput, ChromaDBOutput, ChromaDBHandlerParams, ChromaDBHandlerResult, ChromaDBSearchResult } from './chromadb';
|
|
34
36
|
export type { GitMcpInput, GitMcpOutput, GitMcpHandlerParams, GitMcpHandlerResult } from './gitmcp';
|
|
35
37
|
export type { RagInput, RagOutput, RagHandlerParams, RagHandlerResult, ConversationMessage } from './rag';
|
|
38
|
+
export type { LlmInput, LlmOutput, LlmHandlerParams, LlmHandlerResult } from './llm';
|
|
36
39
|
export type { ChatInput, ChatOutput, ChatHandlerParams, ChatHandlerResult } from './chat';
|
|
37
40
|
/**
|
|
38
41
|
* All agent metadata for UI display
|
|
@@ -82,13 +85,19 @@ export declare const allAgentMetadata: readonly [{
|
|
|
82
85
|
}, {
|
|
83
86
|
readonly id: "rag";
|
|
84
87
|
readonly name: "RAG Intelligence Agent";
|
|
85
|
-
readonly description: "Generates natural language answers based on provided context using Gemini";
|
|
88
|
+
readonly description: "Generates natural language answers based on provided document context using Gemini";
|
|
86
89
|
readonly category: "intelligence";
|
|
87
90
|
readonly route: "/agents/rag";
|
|
91
|
+
}, {
|
|
92
|
+
readonly id: "llm";
|
|
93
|
+
readonly name: "LLM Chat Agent";
|
|
94
|
+
readonly description: "Direct LLM interaction with conversation history support (non-RAG)";
|
|
95
|
+
readonly category: "intelligence";
|
|
96
|
+
readonly route: "/agents/llm";
|
|
88
97
|
}, {
|
|
89
98
|
readonly id: "chat";
|
|
90
99
|
readonly name: "Q&A Context Chat Agent";
|
|
91
|
-
readonly description: "Orchestrates RAG pipeline
|
|
100
|
+
readonly description: "Orchestrates RAG pipeline or direct LLM chat based on mode selection";
|
|
92
101
|
readonly category: "chat";
|
|
93
102
|
readonly route: "/agents/chat";
|
|
94
103
|
}];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/agents/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAGH,OAAO,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAC1D,YAAY,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAGpD,OAAO,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AACxC,OAAO,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AAClD,OAAO,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AACxC,OAAO,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAC7C,OAAO,EAAE,uBAAuB,EAAE,MAAM,oBAAoB,CAAC;AAC7D,OAAO,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAC9C,OAAO,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAC1C,OAAO,EAAE,WAAW,EAAE,MAAM,OAAO,CAAC;AACpC,OAAO,EAAE,YAAY,EAAE,MAAM,QAAQ,CAAC;AAGtC,OAAO,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAC;AA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B,EAAE,MAAM,QAAQ,CAAC;AAE1F;;GAEG;AACH,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAWnB,CAAC"}
|
package/dist/agents/index.js
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
* from their respective agent folders when needed.
|
|
8
8
|
*/
|
|
9
9
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
-
exports.allAgentMetadata = exports.ChatOutputSchema = exports.ChatInputSchema = exports.RagOutputSchema = exports.RagInputSchema = exports.GitMcpOutputSchema = exports.GitMcpInputSchema = exports.ChromaDBOutputSchema = exports.ChromaDBInputSchema = exports.GeminiVectorizeOutputSchema = exports.GeminiVectorizeInputSchema = exports.McpToolOutputSchema = exports.McpToolInputSchema = exports.ImageOutputSchema = exports.ImageInputSchema = exports.TranslatorOutputSchema = exports.TranslatorInputSchema = exports.JokerOutputSchema = exports.JokerInputSchema = exports.chatMetadata = exports.ragMetadata = exports.gitmcpMetadata = exports.chromadbMetadata = exports.geminiVectorizeMetadata = exports.mcpToolMetadata = exports.imageMetadata = exports.translatorMetadata = exports.jokerMetadata = exports.agentRegistry = exports.AgentRegistry = void 0;
|
|
10
|
+
exports.allAgentMetadata = exports.ChatOutputSchema = exports.ChatInputSchema = exports.LlmOutputSchema = exports.LlmInputSchema = exports.RagOutputSchema = exports.RagInputSchema = exports.GitMcpOutputSchema = exports.GitMcpInputSchema = exports.ChromaDBOutputSchema = exports.ChromaDBInputSchema = exports.GeminiVectorizeOutputSchema = exports.GeminiVectorizeInputSchema = exports.McpToolOutputSchema = exports.McpToolInputSchema = exports.ImageOutputSchema = exports.ImageInputSchema = exports.TranslatorOutputSchema = exports.TranslatorInputSchema = exports.JokerOutputSchema = exports.JokerInputSchema = exports.chatMetadata = exports.llmMetadata = exports.ragMetadata = exports.gitmcpMetadata = exports.chromadbMetadata = exports.geminiVectorizeMetadata = exports.mcpToolMetadata = exports.imageMetadata = exports.translatorMetadata = exports.jokerMetadata = exports.agentRegistry = exports.AgentRegistry = void 0;
|
|
11
11
|
// Registry exports
|
|
12
12
|
var registry_1 = require("./registry");
|
|
13
13
|
Object.defineProperty(exports, "AgentRegistry", { enumerable: true, get: function () { return registry_1.AgentRegistry; } });
|
|
@@ -29,6 +29,8 @@ var gitmcp_1 = require("./gitmcp");
|
|
|
29
29
|
Object.defineProperty(exports, "gitmcpMetadata", { enumerable: true, get: function () { return gitmcp_1.gitmcpMetadata; } });
|
|
30
30
|
var rag_1 = require("./rag");
|
|
31
31
|
Object.defineProperty(exports, "ragMetadata", { enumerable: true, get: function () { return rag_1.ragMetadata; } });
|
|
32
|
+
var llm_1 = require("./llm");
|
|
33
|
+
Object.defineProperty(exports, "llmMetadata", { enumerable: true, get: function () { return llm_1.llmMetadata; } });
|
|
32
34
|
var chat_1 = require("./chat");
|
|
33
35
|
Object.defineProperty(exports, "chatMetadata", { enumerable: true, get: function () { return chat_1.chatMetadata; } });
|
|
34
36
|
// Schema exports (client-safe)
|
|
@@ -56,6 +58,9 @@ Object.defineProperty(exports, "GitMcpOutputSchema", { enumerable: true, get: fu
|
|
|
56
58
|
var rag_2 = require("./rag");
|
|
57
59
|
Object.defineProperty(exports, "RagInputSchema", { enumerable: true, get: function () { return rag_2.RagInputSchema; } });
|
|
58
60
|
Object.defineProperty(exports, "RagOutputSchema", { enumerable: true, get: function () { return rag_2.RagOutputSchema; } });
|
|
61
|
+
var llm_2 = require("./llm");
|
|
62
|
+
Object.defineProperty(exports, "LlmInputSchema", { enumerable: true, get: function () { return llm_2.LlmInputSchema; } });
|
|
63
|
+
Object.defineProperty(exports, "LlmOutputSchema", { enumerable: true, get: function () { return llm_2.LlmOutputSchema; } });
|
|
59
64
|
var chat_2 = require("./chat");
|
|
60
65
|
Object.defineProperty(exports, "ChatInputSchema", { enumerable: true, get: function () { return chat_2.ChatInputSchema; } });
|
|
61
66
|
Object.defineProperty(exports, "ChatOutputSchema", { enumerable: true, get: function () { return chat_2.ChatOutputSchema; } });
|
|
@@ -70,7 +75,8 @@ exports.allAgentMetadata = [
|
|
|
70
75
|
{ id: 'gemini-vectorize', name: 'Gemini Vectorize Agent', description: "Generates text embeddings using Google's Gemini text-embedding-004 model", category: 'ai-service', route: '/agents/gemini-vectorize' },
|
|
71
76
|
{ id: 'chromadb', name: 'ChromaDB Agent', description: 'Vector storage and retrieval using ChromaDB. Supports local and cloud deployments.', category: 'database', route: '/agents/chromadb' },
|
|
72
77
|
{ id: 'gitmcp', name: 'GitMCP Documentation Agent', description: 'Fetches and chunks GitHub repository documentation via gitmcp.io MCP servers', category: 'integration', route: '/agents/gitmcp' },
|
|
73
|
-
{ id: 'rag', name: 'RAG Intelligence Agent', description: 'Generates natural language answers based on provided context using Gemini', category: 'intelligence', route: '/agents/rag' },
|
|
74
|
-
{ id: '
|
|
78
|
+
{ id: 'rag', name: 'RAG Intelligence Agent', description: 'Generates natural language answers based on provided document context using Gemini', category: 'intelligence', route: '/agents/rag' },
|
|
79
|
+
{ id: 'llm', name: 'LLM Chat Agent', description: 'Direct LLM interaction with conversation history support (non-RAG)', category: 'intelligence', route: '/agents/llm' },
|
|
80
|
+
{ id: 'chat', name: 'Q&A Context Chat Agent', description: 'Orchestrates RAG pipeline or direct LLM chat based on mode selection', category: 'chat', route: '/agents/chat' },
|
|
75
81
|
];
|
|
76
82
|
//# sourceMappingURL=index.js.map
|
package/dist/agents/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/agents/index.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;;;AAEH,mBAAmB;AACnB,uCAA0D;AAAjD,yGAAA,aAAa,OAAA;AAAE,yGAAA,aAAa,OAAA;AAGrC,uCAAuC;AACvC,iCAAwC;AAA/B,sGAAA,aAAa,OAAA;AACtB,2CAAkD;AAAzC,gHAAA,kBAAkB,OAAA;AAC3B,iCAAwC;AAA/B,sGAAA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,7 @@ import 'server-only';
|
|
|
2
2
|
import type { ExecutionContext } from '../../types/executionContext';
|
|
3
3
|
import type { JokeHandlerParams, JokeHandlerResult } from './joker.types';
|
|
4
4
|
/**
|
|
5
|
-
* Execute joke generation using
|
|
5
|
+
* Execute joke generation using configured LLM provider
|
|
6
6
|
*/
|
|
7
7
|
export declare function executeJokeHandler(params: JokeHandlerParams, props: Record<string, string>, context: ExecutionContext): Promise<JokeHandlerResult>;
|
|
8
8
|
//# sourceMappingURL=joker.handler.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"joker.handler.d.ts","sourceRoot":"","sources":["../../../src/agents/joker/joker.handler.ts"],"names":[],"mappings":"AAAA,OAAO,aAAa,CAAC;AASrB,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAC;AACrE,OAAO,KAAK,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"joker.handler.d.ts","sourceRoot":"","sources":["../../../src/agents/joker/joker.handler.ts"],"names":[],"mappings":"AAAA,OAAO,aAAa,CAAC;AASrB,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAC;AACrE,OAAO,KAAK,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAE1E;;GAEG;AACH,wBAAsB,kBAAkB,CACtC,MAAM,EAAE,iBAAiB,EACzB,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,EAC7B,OAAO,EAAE,gBAAgB,GACxB,OAAO,CAAC,iBAAiB,CAAC,CAmC5B"}
|
|
@@ -4,24 +4,19 @@ exports.executeJokeHandler = executeJokeHandler;
|
|
|
4
4
|
require("server-only");
|
|
5
5
|
/**
|
|
6
6
|
* Joker Agent Handler - Server-only execution logic
|
|
7
|
-
* Generates jokes using Gemini
|
|
7
|
+
* Generates jokes using LLM providers (Google Gemini by default)
|
|
8
8
|
*/
|
|
9
9
|
const ai_1 = require("ai");
|
|
10
|
-
const
|
|
11
|
-
const GEMINI_MODEL = 'models/gemini-2.5-flash';
|
|
10
|
+
const llmProviderFactory_1 = require("../../runtime/llmProviderFactory");
|
|
12
11
|
/**
|
|
13
|
-
* Execute joke generation using
|
|
12
|
+
* Execute joke generation using configured LLM provider
|
|
14
13
|
*/
|
|
15
14
|
async function executeJokeHandler(params, props, context) {
|
|
16
|
-
const
|
|
17
|
-
|
|
18
|
-
throw new Error('Missing required prop: gemini_api_key');
|
|
19
|
-
}
|
|
15
|
+
const providerConfig = (0, llmProviderFactory_1.extractProviderConfig)(props, 'google');
|
|
16
|
+
const model = llmProviderFactory_1.LLMProviderFactory.createLanguageModel(providerConfig);
|
|
20
17
|
const prompt = params.prompt?.trim() || 'Tell a short and original joke that works for any audience.';
|
|
21
18
|
const temperature = params.temperature ?? 0.8;
|
|
22
19
|
const maxTokens = params.maxTokens;
|
|
23
|
-
const google = (0, google_1.createGoogleGenerativeAI)({ apiKey });
|
|
24
|
-
const model = google(GEMINI_MODEL);
|
|
25
20
|
const startTime = Date.now();
|
|
26
21
|
context.log(`[Joker] Generating joke with temperature=${temperature}`);
|
|
27
22
|
const { text } = await (0, ai_1.generateText)({
|
|
@@ -37,7 +32,8 @@ async function executeJokeHandler(params, props, context) {
|
|
|
37
32
|
return {
|
|
38
33
|
text: finalText,
|
|
39
34
|
metadata: {
|
|
40
|
-
model_used:
|
|
35
|
+
model_used: providerConfig.model || llmProviderFactory_1.LLMProviderFactory.getDefaultModel(providerConfig.provider),
|
|
36
|
+
provider: providerConfig.provider,
|
|
41
37
|
processing_time: Date.now() - startTime,
|
|
42
38
|
temperature,
|
|
43
39
|
max_tokens: maxTokens ?? null,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"joker.handler.js","sourceRoot":"","sources":["../../../src/agents/joker/joker.handler.ts"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"joker.handler.js","sourceRoot":"","sources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AS;YACvC,WAAW;YACX,UAAU,EAAE,SAAS,IAAI,IAAI;YAC7B,WAAW,EAAE,MAAM;SACpB;KACF,CAAC;AACJ,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"joker.types.d.ts","sourceRoot":"","sources":["../../../src/agents/joker/joker.types.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH;;GAEG;AACH,MAAM,WAAW,iBAAiB;IAChC,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED;;GAEG;AACH,MAAM,WAAW,iBAAiB;IAChC,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE;QACR,UAAU,EAAE,MAAM,CAAC;QACnB,eAAe,EAAE,MAAM,CAAC;QACxB,WAAW,EAAE,MAAM,CAAC;QACpB,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;QAC1B,WAAW,EAAE,MAAM,CAAC;KACrB,CAAC;CACH;AAED;;GAEG;AACH,MAAM,WAAW,aAAa;IAC5B,EAAE,EAAE,OAAO,CAAC;IACZ,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,SAAS,CAAC;IACpB,KAAK,EAAE,eAAe,CAAC;CACxB"}
|
|
1
|
+
{"version":3,"file":"joker.types.d.ts","sourceRoot":"","sources":["../../../src/agents/joker/joker.types.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH;;GAEG;AACH,MAAM,WAAW,iBAAiB;IAChC,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED;;GAEG;AACH,MAAM,WAAW,iBAAiB;IAChC,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE;QACR,UAAU,EAAE,MAAM,CAAC;QACnB,QAAQ,EAAE,MAAM,CAAC;QACjB,eAAe,EAAE,MAAM,CAAC;QACxB,WAAW,EAAE,MAAM,CAAC;QACpB,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;QAC1B,WAAW,EAAE,MAAM,CAAC;KACrB,CAAC;CACH;AAED;;GAEG;AACH,MAAM,WAAW,aAAa;IAC5B,EAAE,EAAE,OAAO,CAAC;IACZ,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,SAAS,CAAC;IACpB,KAAK,EAAE,eAAe,CAAC;CACxB"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* LLM Agent - Public exports (client-safe)
|
|
3
|
+
*/
|
|
4
|
+
export { LlmInputSchema, LlmOutputSchema } from './llm.schema';
|
|
5
|
+
export type { LlmInput, LlmOutput } from './llm.schema';
|
|
6
|
+
export type { LlmHandlerParams, LlmHandlerResult, LlmMetadata } from './llm.types';
|
|
7
|
+
export declare const llmMetadata: {
|
|
8
|
+
readonly id: "llm";
|
|
9
|
+
readonly name: "LLM Chat Agent";
|
|
10
|
+
readonly description: "Direct LLM interaction with conversation history support (non-RAG)";
|
|
11
|
+
readonly category: "intelligence";
|
|
12
|
+
readonly route: "/agents/llm";
|
|
13
|
+
readonly tags: readonly ["llm", "chat", "gemini", "conversation"];
|
|
14
|
+
};
|
|
15
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/agents/llm/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAGH,OAAO,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAC/D,YAAY,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAGxD,YAAY,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAGnF,eAAO,MAAM,WAAW;;;;;;;CAOd,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* LLM Agent - Public exports (client-safe)
|
|
4
|
+
*/
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.llmMetadata = exports.LlmOutputSchema = exports.LlmInputSchema = void 0;
|
|
7
|
+
// Schema exports (client-safe)
|
|
8
|
+
var llm_schema_1 = require("./llm.schema");
|
|
9
|
+
Object.defineProperty(exports, "LlmInputSchema", { enumerable: true, get: function () { return llm_schema_1.LlmInputSchema; } });
|
|
10
|
+
Object.defineProperty(exports, "LlmOutputSchema", { enumerable: true, get: function () { return llm_schema_1.LlmOutputSchema; } });
|
|
11
|
+
// Metadata (client-safe)
|
|
12
|
+
exports.llmMetadata = {
|
|
13
|
+
id: 'llm',
|
|
14
|
+
name: 'LLM Chat Agent',
|
|
15
|
+
description: 'Direct LLM interaction with conversation history support (non-RAG)',
|
|
16
|
+
category: 'intelligence',
|
|
17
|
+
route: '/agents/llm',
|
|
18
|
+
tags: ['llm', 'chat', 'gemini', 'conversation'],
|
|
19
|
+
};
|
|
20
|
+
//# sourceMappingURL=index.js.map
|