Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Backport] Update @elastic/appex-ai-infra (main) (#200579) #202809

Merged
merged 3 commits into from
Dec 5, 2024
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
28 changes: 14 additions & 14 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@
"@types/react": "~18.2.0",
"@types/react-dom": "~18.2.0",
"@xstate5/react/**/xstate": "^5.18.1",
"globby/fast-glob": "^3.2.11"
"globby/fast-glob": "^3.3.2"
},
"dependencies": {
"@appland/sql-parser": "^1.5.1",
Expand Down Expand Up @@ -1029,7 +1029,7 @@
"@langchain/google-vertexai": "^0.1.0",
"@langchain/langgraph": "0.2.19",
"@langchain/openai": "^0.3.11",
"@langtrase/trace-attributes": "^3.0.8",
"@langtrase/trace-attributes": "^7.5.0",
"@launchdarkly/node-server-sdk": "^9.7.2",
"@launchdarkly/openfeature-node-server": "^1.0.0",
"@loaders.gl/core": "^3.4.7",
Expand All @@ -1056,12 +1056,12 @@
"@reduxjs/toolkit": "1.9.7",
"@slack/webhook": "^7.0.1",
"@smithy/eventstream-codec": "^3.1.1",
"@smithy/eventstream-serde-node": "^3.0.3",
"@smithy/eventstream-serde-node": "^3.0.12",
"@smithy/middleware-stack": "^3.0.10",
"@smithy/node-http-handler": "^3.3.1",
"@smithy/protocol-http": "^4.1.7",
"@smithy/signature-v4": "^3.1.1",
"@smithy/types": "^3.2.0",
"@smithy/signature-v4": "^4.2.3",
"@smithy/types": "^3.7.1",
"@smithy/util-utf8": "^3.0.0",
"@tanstack/react-query": "^4.29.12",
"@tanstack/react-query-devtools": "^4.29.12",
Expand All @@ -1080,12 +1080,12 @@
"@xyflow/react": "^12.3.2",
"adm-zip": "^0.5.9",
"ai": "^2.2.33",
"ajv": "^8.12.0",
"ansi-regex": "^6.0.1",
"ajv": "^8.17.1",
"ansi-regex": "^6.1.0",
"antlr4": "^4.13.1-patch-1",
"archiver": "^7.0.1",
"async": "^3.2.3",
"aws4": "^1.12.0",
"aws4": "^1.13.2",
"axios": "^1.7.4",
"base64-js": "^1.3.1",
"bitmap-sdf": "^1.0.3",
Expand Down Expand Up @@ -1128,7 +1128,7 @@
"dotenv": "^16.4.5",
"elastic-apm-node": "^4.7.3",
"email-addresses": "^5.0.0",
"eventsource-parser": "^1.1.1",
"eventsource-parser": "^3.0.0",
"execa": "^5.1.1",
"expiry-js": "0.1.7",
"exponential-backoff": "^3.1.1",
Expand All @@ -1146,7 +1146,7 @@
"getos": "^3.1.0",
"globby": "^11.1.0",
"google-auth-library": "^9.10.0",
"gpt-tokenizer": "^2.1.2",
"gpt-tokenizer": "^2.6.2",
"handlebars": "4.7.8",
"he": "^1.2.0",
"history": "^4.9.0",
Expand Down Expand Up @@ -1174,7 +1174,7 @@
"jsts": "^1.6.2",
"kea": "^2.6.0",
"langchain": "^0.3.5",
"langsmith": "^0.2.3",
"langsmith": "^0.2.5",
"launchdarkly-js-client-sdk": "^3.5.0",
"load-json-file": "^6.2.0",
"lodash": "^4.17.21",
Expand Down Expand Up @@ -1203,7 +1203,7 @@
"nunjucks": "^3.2.4",
"object-hash": "^1.3.1",
"object-path-immutable": "^3.1.1",
"openai": "^4.68.0",
"openai": "^4.72.0",
"openpgp": "5.10.1",
"opn": "^5.5.0",
"ora": "^4.0.4",
Expand Down Expand Up @@ -1590,7 +1590,7 @@
"@types/js-search": "^1.4.0",
"@types/js-yaml": "^3.11.1",
"@types/jsdom": "^20.0.1",
"@types/json-schema": "^7",
"@types/json-schema": "^7.0.15",
"@types/json-stable-stringify": "^1.0.32",
"@types/json5": "^2.2.0",
"@types/jsonwebtoken": "^9.0.0",
Expand Down Expand Up @@ -1834,7 +1834,7 @@
"svgo": "^2.8.0",
"swagger-jsdoc": "^6.2.8",
"swagger-ui-express": "^5.0.1",
"table": "^6.8.1",
"table": "^6.8.2",
"tape": "^5.0.1",
"terser": "^5.31.6",
"terser-webpack-plugin": "^4.2.3",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,10 @@ export function createObservableFromHttpResponse(
}

return new Observable<string>((subscriber) => {
const parser = createParser((event) => {
if (event.type === 'event') {
const parser = createParser({
onEvent: (event) => {
subscriber.next(event.data);
}
},
});

const readStream = async () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ export function createObservableFromHttpResponse<T extends ServerSentEvent = nev
}

return new Observable<T>((subscriber) => {
const parser = createParser((event) => {
if (event.type === 'event')
const parser = createParser({
onEvent: (event) => {
try {
const data = JSON.parse(event.data);
if (event.event === 'error') {
Expand All @@ -48,6 +48,7 @@ export function createObservableFromHttpResponse<T extends ServerSentEvent = nev
} catch (error) {
subscriber.error(createSSEInternalError(`Failed to parse JSON`));
}
},
});

const readStream = async () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,10 @@ export function createObservableFromHttpResponse(
}

return new Observable<string>((subscriber) => {
const parser = createParser((event) => {
if (event.type === 'event') {
const parser = createParser({
onEvent: (event) => {
subscriber.next(event.data);
}
},
});

const readStream = async () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ import { Observable } from 'rxjs';

export function eventSourceStreamIntoObservable(readable: Readable) {
return new Observable<string>((subscriber) => {
const parser = createParser((event) => {
if (event.type === 'event') {
const parser = createParser({
onEvent: (event) => {
subscriber.next(event.data);
}
},
});

async function processStream() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,10 +72,10 @@ describe('observableIntoEventSourceStream', () => {

const events: Array<Record<string, any>> = [];

const parser = createParser((event) => {
if (event.type === 'event') {
const parser = createParser({
onEvent: (event) => {
events.push(JSON.parse(event.data));
}
},
});

chunks.forEach((chunk) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,10 @@ export function withLangtraceChatCompleteSpan<T extends ChatEvent>({
'http.max.retries': 0,
// dummy URL
'url.full': 'http://localhost:3000/chat/completions',
'url.path': '/chat/completions',
'http.timeout': 120 * 1000,
'gen_ai.operation.name': 'chat_completion',
'gen_ai.request.model': model,
'llm.prompts': JSON.stringify(
messages.map((message) => ({
role: message.message.role,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@ import { Observable } from 'rxjs';

export function eventsourceStreamIntoObservable(readable: Readable) {
return new Observable<string>((subscriber) => {
const parser = createParser((event) => {
if (event.type === 'event') {
const parser = createParser({
onEvent: (event) => {
subscriber.next(event.data);
}
},
});

async function processStream() {
Expand Down
Loading
Loading