@copilotkit/runtime 1.4.8-next.0 → 1.4.8-next.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/CHANGELOG.md +17 -0
- package/__snapshots__/schema/schema.graphql +1 -0
- package/dist/{chunk-CDXNOPUW.mjs → chunk-4DFIC23L.mjs} +2 -2
- package/dist/{chunk-DOQSOWZS.mjs → chunk-4OJDHGJU.mjs} +2 -2
- package/dist/{chunk-3KW7FFG5.mjs → chunk-6SSIGQER.mjs} +2 -2
- package/dist/{chunk-OKQVDDJ2.mjs → chunk-AKGNTDRV.mjs} +63 -2
- package/dist/chunk-AKGNTDRV.mjs.map +1 -0
- package/dist/{chunk-U6LFW34R.mjs → chunk-MCVGZ4ZG.mjs} +16 -8
- package/dist/chunk-MCVGZ4ZG.mjs.map +1 -0
- package/dist/{copilot-runtime-12e7ac40.d.ts → copilot-runtime-1c5bf72b.d.ts} +1 -1
- package/dist/{groq-adapter-24abe931.d.ts → groq-adapter-b6a40422.d.ts} +1 -1
- package/dist/index.d.ts +4 -4
- package/dist/index.js +96 -25
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +9 -5
- package/dist/index.mjs.map +1 -1
- package/dist/{langserve-f021ab9c.d.ts → langserve-6245df39.d.ts} +2 -1
- package/dist/lib/index.d.ts +3 -3
- package/dist/lib/index.js +24 -6
- package/dist/lib/index.js.map +1 -1
- package/dist/lib/index.mjs +5 -5
- package/dist/lib/integrations/index.d.ts +3 -3
- package/dist/lib/integrations/index.js +10 -3
- package/dist/lib/integrations/index.js.map +1 -1
- package/dist/lib/integrations/index.mjs +5 -5
- package/dist/lib/integrations/nest/index.d.ts +2 -2
- package/dist/lib/integrations/nest/index.js +10 -3
- package/dist/lib/integrations/nest/index.js.map +1 -1
- package/dist/lib/integrations/nest/index.mjs +3 -3
- package/dist/lib/integrations/node-express/index.d.ts +2 -2
- package/dist/lib/integrations/node-express/index.js +10 -3
- package/dist/lib/integrations/node-express/index.js.map +1 -1
- package/dist/lib/integrations/node-express/index.mjs +3 -3
- package/dist/lib/integrations/node-http/index.d.ts +2 -2
- package/dist/lib/integrations/node-http/index.js +10 -3
- package/dist/lib/integrations/node-http/index.js.map +1 -1
- package/dist/lib/integrations/node-http/index.mjs +2 -2
- package/dist/service-adapters/index.d.ts +35 -4
- package/dist/service-adapters/index.js +63 -0
- package/dist/service-adapters/index.js.map +1 -1
- package/dist/service-adapters/index.mjs +5 -1
- package/package.json +2 -2
- package/src/graphql/inputs/forwarded-parameters.input.ts +3 -0
- package/src/lib/logger.ts +1 -1
- package/src/lib/runtime/remote-action-constructors.ts +61 -57
- package/src/service-adapters/anthropic/anthropic-adapter.ts +1 -0
- package/src/service-adapters/experimental/empty/empty-adapter.ts +33 -0
- package/src/service-adapters/groq/groq-adapter.ts +1 -0
- package/src/service-adapters/index.ts +7 -1
- package/src/service-adapters/openai/openai-adapter.ts +1 -0
- package/src/service-adapters/unify/unify-adapter.ts +2 -0
- package/dist/chunk-OKQVDDJ2.mjs.map +0 -1
- package/dist/chunk-U6LFW34R.mjs.map +0 -1
- /package/dist/{chunk-CDXNOPUW.mjs.map → chunk-4DFIC23L.mjs.map} +0 -0
- /package/dist/{chunk-DOQSOWZS.mjs.map → chunk-4OJDHGJU.mjs.map} +0 -0
- /package/dist/{chunk-3KW7FFG5.mjs.map → chunk-6SSIGQER.mjs.map} +0 -0
package/dist/index.mjs
CHANGED
|
@@ -3,13 +3,13 @@ import {
|
|
|
3
3
|
config,
|
|
4
4
|
copilotRuntimeNextJSAppRouterEndpoint,
|
|
5
5
|
copilotRuntimeNextJSPagesRouterEndpoint
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-4OJDHGJU.mjs";
|
|
7
7
|
import {
|
|
8
8
|
copilotRuntimeNestEndpoint
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-6SSIGQER.mjs";
|
|
10
10
|
import {
|
|
11
11
|
copilotRuntimeNodeExpressEndpoint
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-4DFIC23L.mjs";
|
|
13
13
|
import {
|
|
14
14
|
CopilotRuntime,
|
|
15
15
|
buildSchema,
|
|
@@ -20,9 +20,11 @@ import {
|
|
|
20
20
|
getCommonConfig,
|
|
21
21
|
langGraphPlatformEndpoint,
|
|
22
22
|
resolveEndpointType
|
|
23
|
-
} from "./chunk-
|
|
23
|
+
} from "./chunk-MCVGZ4ZG.mjs";
|
|
24
24
|
import {
|
|
25
25
|
AnthropicAdapter,
|
|
26
|
+
ExperimentalEmptyAdapter,
|
|
27
|
+
ExperimentalOllamaAdapter,
|
|
26
28
|
GoogleGenerativeAIAdapter,
|
|
27
29
|
GroqAdapter,
|
|
28
30
|
LangChainAdapter,
|
|
@@ -30,7 +32,7 @@ import {
|
|
|
30
32
|
OpenAIAssistantAdapter,
|
|
31
33
|
RemoteChain,
|
|
32
34
|
UnifyAdapter
|
|
33
|
-
} from "./chunk-
|
|
35
|
+
} from "./chunk-AKGNTDRV.mjs";
|
|
34
36
|
import {
|
|
35
37
|
GuardrailsValidationFailureResponse,
|
|
36
38
|
MessageStreamInterruptedResponse,
|
|
@@ -45,6 +47,8 @@ import "reflect-metadata";
|
|
|
45
47
|
export {
|
|
46
48
|
AnthropicAdapter,
|
|
47
49
|
CopilotRuntime,
|
|
50
|
+
ExperimentalEmptyAdapter,
|
|
51
|
+
ExperimentalOllamaAdapter,
|
|
48
52
|
GoogleGenerativeAIAdapter,
|
|
49
53
|
GroqAdapter,
|
|
50
54
|
GuardrailsValidationFailureResponse,
|
package/dist/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/index.ts"],"sourcesContent":["import \"reflect-metadata\";\nexport * from \"./lib\";\nexport * from \"./utils\";\nexport * from \"./service-adapters\";\n"],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../src/index.ts"],"sourcesContent":["import \"reflect-metadata\";\nexport * from \"./lib\";\nexport * from \"./utils\";\nexport * from \"./service-adapters\";\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,OAAO;","names":[]}
|
|
@@ -96,6 +96,7 @@ declare class ForwardedParametersInput {
|
|
|
96
96
|
stop?: string[];
|
|
97
97
|
toolChoice?: String;
|
|
98
98
|
toolChoiceFunctionName?: string;
|
|
99
|
+
temperature?: number;
|
|
99
100
|
}
|
|
100
101
|
|
|
101
102
|
interface CopilotRuntimeChatCompletionRequest {
|
|
@@ -133,4 +134,4 @@ declare class RemoteChain {
|
|
|
133
134
|
inferLangServeParameters(): Promise<void>;
|
|
134
135
|
}
|
|
135
136
|
|
|
136
|
-
export { ActionInput as A,
|
|
137
|
+
export { ActionInput as A, CopilotRuntimeChatCompletionRequest as C, ForwardedParametersInput as F, RemoteChainParameters as R, CopilotRuntimeChatCompletionResponse as a, CopilotServiceAdapter as b, RemoteChain as c, RuntimeEventSource as d };
|
package/dist/lib/index.d.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
export { h as CommonConfig, b as CopilotRequestContextProperties, a as CopilotRuntime, C as CopilotRuntimeConstructorParams, d as CreateCopilotRuntimeServerOptions, G as GraphQLContext, g as buildSchema, c as copilotKitEndpoint, e as createContext, f as flattenToolCallsNoDuplicates, i as getCommonConfig, l as langGraphPlatformEndpoint, r as resolveEndpointType } from '../copilot-runtime-
|
|
2
|
-
export { G as GoogleGenerativeAIAdapter, f as GroqAdapter, e as GroqAdapterParams, L as LangChainAdapter, a as OpenAIAdapter, O as OpenAIAdapterParams, c as OpenAIAssistantAdapter, b as OpenAIAssistantAdapterParams, d as UnifyAdapter, U as UnifyAdapterParams } from '../groq-adapter-
|
|
1
|
+
export { h as CommonConfig, b as CopilotRequestContextProperties, a as CopilotRuntime, C as CopilotRuntimeConstructorParams, d as CreateCopilotRuntimeServerOptions, G as GraphQLContext, g as buildSchema, c as copilotKitEndpoint, e as createContext, f as flattenToolCallsNoDuplicates, i as getCommonConfig, l as langGraphPlatformEndpoint, r as resolveEndpointType } from '../copilot-runtime-1c5bf72b.js';
|
|
2
|
+
export { G as GoogleGenerativeAIAdapter, f as GroqAdapter, e as GroqAdapterParams, L as LangChainAdapter, a as OpenAIAdapter, O as OpenAIAdapterParams, c as OpenAIAssistantAdapter, b as OpenAIAssistantAdapterParams, d as UnifyAdapter, U as UnifyAdapterParams } from '../groq-adapter-b6a40422.js';
|
|
3
3
|
export { CopilotRuntimeServerInstance, config, copilotRuntimeNextJSAppRouterEndpoint, copilotRuntimeNextJSPagesRouterEndpoint } from './integrations/index.js';
|
|
4
4
|
export { copilotRuntimeNodeHttpEndpoint } from './integrations/node-http/index.js';
|
|
5
5
|
export { copilotRuntimeNodeExpressEndpoint } from './integrations/node-express/index.js';
|
|
6
6
|
export { copilotRuntimeNestEndpoint } from './integrations/nest/index.js';
|
|
7
7
|
import '@copilotkit/shared';
|
|
8
|
-
import '../langserve-
|
|
8
|
+
import '../langserve-6245df39.js';
|
|
9
9
|
import '../index-10b1c870.js';
|
|
10
10
|
import '../graphql/types/base/index.js';
|
|
11
11
|
import 'rxjs';
|
package/dist/lib/index.js
CHANGED
|
@@ -44,7 +44,7 @@ var require_package = __commonJS({
|
|
|
44
44
|
publishConfig: {
|
|
45
45
|
access: "public"
|
|
46
46
|
},
|
|
47
|
-
version: "1.4.8-next.
|
|
47
|
+
version: "1.4.8-next.2",
|
|
48
48
|
sideEffects: false,
|
|
49
49
|
main: "./dist/index.js",
|
|
50
50
|
module: "./dist/index.mjs",
|
|
@@ -419,6 +419,9 @@ var OpenAIAdapter = class {
|
|
|
419
419
|
},
|
|
420
420
|
...this.disableParallelToolCalls && {
|
|
421
421
|
parallel_tool_calls: false
|
|
422
|
+
},
|
|
423
|
+
...(forwardedParameters == null ? void 0 : forwardedParameters.temperature) && {
|
|
424
|
+
temperature: forwardedParameters.temperature
|
|
422
425
|
}
|
|
423
426
|
});
|
|
424
427
|
eventSource.stream(async (eventStream$) => {
|
|
@@ -889,6 +892,7 @@ var UnifyAdapter = class {
|
|
|
889
892
|
apiKey: this.apiKey,
|
|
890
893
|
baseURL: "https://api.unify.ai/v0/"
|
|
891
894
|
});
|
|
895
|
+
const forwardedParameters = request.forwardedParameters;
|
|
892
896
|
const messages = request.messages.map(convertMessageToOpenAIMessage);
|
|
893
897
|
const stream = await openai.chat.completions.create({
|
|
894
898
|
model: this.model,
|
|
@@ -896,6 +900,9 @@ var UnifyAdapter = class {
|
|
|
896
900
|
stream: true,
|
|
897
901
|
...tools.length > 0 && {
|
|
898
902
|
tools
|
|
903
|
+
},
|
|
904
|
+
...(forwardedParameters == null ? void 0 : forwardedParameters.temperature) && {
|
|
905
|
+
temperature: forwardedParameters.temperature
|
|
899
906
|
}
|
|
900
907
|
});
|
|
901
908
|
let model = null;
|
|
@@ -999,6 +1006,9 @@ var GroqAdapter = class {
|
|
|
999
1006
|
},
|
|
1000
1007
|
...this.disableParallelToolCalls && {
|
|
1001
1008
|
parallel_tool_calls: false
|
|
1009
|
+
},
|
|
1010
|
+
...(forwardedParameters == null ? void 0 : forwardedParameters.temperature) && {
|
|
1011
|
+
temperature: forwardedParameters.temperature
|
|
1002
1012
|
}
|
|
1003
1013
|
});
|
|
1004
1014
|
eventSource.stream(async (eventStream$) => {
|
|
@@ -1830,6 +1840,7 @@ function constructLGCRemoteAction({ endpoint, graphqlContext, logger: logger2, m
|
|
|
1830
1840
|
}
|
|
1831
1841
|
__name(constructLGCRemoteAction, "constructLGCRemoteAction");
|
|
1832
1842
|
function constructRemoteActions({ json, url, onBeforeRequest, graphqlContext, logger: logger2, messages, agentStates }) {
|
|
1843
|
+
const totalAgents = Array.isArray(json["agents"]) ? json["agents"].length : 0;
|
|
1833
1844
|
const actions = json["actions"].map((action) => ({
|
|
1834
1845
|
name: action.name,
|
|
1835
1846
|
description: action.description,
|
|
@@ -1843,7 +1854,7 @@ function constructRemoteActions({ json, url, onBeforeRequest, graphqlContext, lo
|
|
|
1843
1854
|
telemetry_client_default.capture("oss.runtime.remote_action_executed", {
|
|
1844
1855
|
agentExecution: false,
|
|
1845
1856
|
type: "self-hosted",
|
|
1846
|
-
agentsAmount:
|
|
1857
|
+
agentsAmount: totalAgents
|
|
1847
1858
|
});
|
|
1848
1859
|
try {
|
|
1849
1860
|
const response = await fetch(`${url}/actions/execute`, {
|
|
@@ -1878,7 +1889,7 @@ function constructRemoteActions({ json, url, onBeforeRequest, graphqlContext, lo
|
|
|
1878
1889
|
}
|
|
1879
1890
|
}
|
|
1880
1891
|
}));
|
|
1881
|
-
const agents = json["agents"].map((agent) => ({
|
|
1892
|
+
const agents = totalAgents ? json["agents"].map((agent) => ({
|
|
1882
1893
|
name: agent.name,
|
|
1883
1894
|
description: agent.description,
|
|
1884
1895
|
parameters: [],
|
|
@@ -1931,7 +1942,7 @@ function constructRemoteActions({ json, url, onBeforeRequest, graphqlContext, lo
|
|
|
1931
1942
|
streamResponse(response.body, eventSource.eventStream$);
|
|
1932
1943
|
return eventSource.processLangGraphEvents();
|
|
1933
1944
|
}
|
|
1934
|
-
}));
|
|
1945
|
+
})) : [];
|
|
1935
1946
|
return [
|
|
1936
1947
|
...actions,
|
|
1937
1948
|
...agents
|
|
@@ -3086,6 +3097,7 @@ var ForwardedParametersInput = class {
|
|
|
3086
3097
|
stop;
|
|
3087
3098
|
toolChoice;
|
|
3088
3099
|
toolChoiceFunctionName;
|
|
3100
|
+
temperature;
|
|
3089
3101
|
};
|
|
3090
3102
|
__name(ForwardedParametersInput, "ForwardedParametersInput");
|
|
3091
3103
|
_ts_decorate7([
|
|
@@ -3120,6 +3132,12 @@ _ts_decorate7([
|
|
|
3120
3132
|
}),
|
|
3121
3133
|
_ts_metadata7("design:type", String)
|
|
3122
3134
|
], ForwardedParametersInput.prototype, "toolChoiceFunctionName", void 0);
|
|
3135
|
+
_ts_decorate7([
|
|
3136
|
+
(0, import_type_graphql8.Field)(() => Number, {
|
|
3137
|
+
nullable: true
|
|
3138
|
+
}),
|
|
3139
|
+
_ts_metadata7("design:type", Number)
|
|
3140
|
+
], ForwardedParametersInput.prototype, "temperature", void 0);
|
|
3123
3141
|
ForwardedParametersInput = _ts_decorate7([
|
|
3124
3142
|
(0, import_type_graphql8.InputType)()
|
|
3125
3143
|
], ForwardedParametersInput);
|
|
@@ -4171,8 +4189,8 @@ function createLogger(options) {
|
|
|
4171
4189
|
level: process.env.LOG_LEVEL || level || "error",
|
|
4172
4190
|
redact: {
|
|
4173
4191
|
paths: [
|
|
4174
|
-
"
|
|
4175
|
-
"
|
|
4192
|
+
"pid",
|
|
4193
|
+
"hostname"
|
|
4176
4194
|
],
|
|
4177
4195
|
remove: true
|
|
4178
4196
|
}
|