openloops 0.1.30 → 0.1.31
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
CHANGED
|
@@ -67,7 +67,7 @@ You know the pattern: before you write a single line of what your agent actually
|
|
|
67
67
|
- **Production-grade tool execution.** Retries on failed steps, confirmation prompts before destructive actions, and graceful resume after a crash are all built into the runtime.
|
|
68
68
|
- **Native MCP support.** Connect any MCP server and its tools become regular tools instantly. No adapter package, no manual schema mapping.
|
|
69
69
|
- **Sub-agent orchestration.** An agent can launch and coordinate other agents to split up a problem. Full guide coming soon.
|
|
70
|
-
- **Any LLM provider, including local ones.** Built on [`@
|
|
70
|
+
- **Any LLM provider, including local ones.** Built on [`@earendil-works/pi-ai`](https://www.npmjs.com/package/@earendil-works/pi-ai), so OpenAI, Anthropic, and self-hosted models (e.g. via Ollama) all work the same way.
|
|
71
71
|
- **Observability without ceremony.** Sentry and Langfuse are built in. Set the environment variables and they turn on, no SDK wiring required.
|
|
72
72
|
- **A loop marketplace.** Don't write a customer-support agent from scratch. Install one.
|
|
73
73
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { KnownProvider, Message, AssistantMessage } from '@
|
|
1
|
+
import type { KnownProvider, Message, AssistantMessage } from '@earendil-works/pi-ai';
|
|
2
2
|
import { CurrentUser } from '../common/base/index.js';
|
|
3
3
|
export declare class LLMClient {
|
|
4
4
|
private readonly logger;
|
|
@@ -54,7 +54,8 @@ class LLMClient {
|
|
|
54
54
|
}
|
|
55
55
|
}
|
|
56
56
|
async complete(params) {
|
|
57
|
-
const {
|
|
57
|
+
const { builtinModels } = await import("@earendil-works/pi-ai/providers/all");
|
|
58
|
+
const models = builtinModels();
|
|
58
59
|
const {
|
|
59
60
|
origin,
|
|
60
61
|
sessionId,
|
|
@@ -66,7 +67,8 @@ class LLMClient {
|
|
|
66
67
|
modelName = "gpt-4o-mini",
|
|
67
68
|
temperature = 0.7
|
|
68
69
|
} = params ?? {};
|
|
69
|
-
const model = getModel(provider, modelName);
|
|
70
|
+
const model = models.getModel(provider, modelName);
|
|
71
|
+
if (!model) throw new Error("[LLM Client] model not found");
|
|
70
72
|
const context = {
|
|
71
73
|
systemPrompt,
|
|
72
74
|
messages
|
|
@@ -95,7 +97,7 @@ class LLMClient {
|
|
|
95
97
|
input: context
|
|
96
98
|
});
|
|
97
99
|
try {
|
|
98
|
-
const response = await complete(model, context, {
|
|
100
|
+
const response = await models.complete(model, context, {
|
|
99
101
|
temperature
|
|
100
102
|
});
|
|
101
103
|
generation?.end({
|
|
@@ -22,7 +22,8 @@ class LLMClient {
|
|
|
22
22
|
}
|
|
23
23
|
}
|
|
24
24
|
async complete(params) {
|
|
25
|
-
const {
|
|
25
|
+
const { builtinModels } = await import("@earendil-works/pi-ai/providers/all");
|
|
26
|
+
const models = builtinModels();
|
|
26
27
|
const {
|
|
27
28
|
origin,
|
|
28
29
|
sessionId,
|
|
@@ -34,7 +35,8 @@ class LLMClient {
|
|
|
34
35
|
modelName = "gpt-4o-mini",
|
|
35
36
|
temperature = 0.7
|
|
36
37
|
} = params ?? {};
|
|
37
|
-
const model = getModel(provider, modelName);
|
|
38
|
+
const model = models.getModel(provider, modelName);
|
|
39
|
+
if (!model) throw new Error("[LLM Client] model not found");
|
|
38
40
|
const context = {
|
|
39
41
|
systemPrompt,
|
|
40
42
|
messages
|
|
@@ -63,7 +65,7 @@ class LLMClient {
|
|
|
63
65
|
input: context
|
|
64
66
|
});
|
|
65
67
|
try {
|
|
66
|
-
const response = await complete(model, context, {
|
|
68
|
+
const response = await models.complete(model, context, {
|
|
67
69
|
temperature
|
|
68
70
|
});
|
|
69
71
|
generation?.end({
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ObjectId } from 'mongodb';
|
|
2
|
-
import type { AssistantMessage } from '@
|
|
2
|
+
import type { AssistantMessage } from '@earendil-works/pi-ai';
|
|
3
3
|
import { BaseEntity, BaseEntityProps } from '../../../common/base/base.entity.js';
|
|
4
4
|
export interface LLMCallProps extends BaseEntityProps {
|
|
5
5
|
origin?: string;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "openloops",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.31",
|
|
4
4
|
"description": "Framework to build AI Agents",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "Jose Barcos",
|
|
@@ -75,7 +75,7 @@
|
|
|
75
75
|
"push": "git push --follow-tags"
|
|
76
76
|
},
|
|
77
77
|
"dependencies": {
|
|
78
|
-
"@
|
|
78
|
+
"@earendil-works/pi-ai": "^1.0.4",
|
|
79
79
|
"@modelcontextprotocol/sdk": "^1.30.1",
|
|
80
80
|
"@sentry/node": "^11.0.0",
|
|
81
81
|
"axios": "^1.20.0",
|