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

[Obs AI Assistant] Add tokenCount event to complete event stream in serverless tests #205397

Merged
merged 2 commits into from
Jan 3, 2025
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
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,7 @@ export default function ApiTest({ getService }: FtrProviderContext) {
},
];

// Failing: See https://github.com/elastic/kibana/issues/203407
describe.skip('/internal/observability_ai_assistant/chat/complete', function () {
describe('/internal/observability_ai_assistant/chat/complete', function () {
// TODO: https://github.com/elastic/kibana/issues/192751
this.tags(['skipMKI']);
let proxy: LlmProxy;
Expand Down Expand Up @@ -107,6 +106,7 @@ export default function ApiTest({ getService }: FtrProviderContext) {

await titleSimulator.status(200);
await titleSimulator.next('My generated title');
await titleSimulator.tokenCount({ completion: 1, prompt: 1, total: 2 });
await titleSimulator.complete();

await conversationSimulator.status(200);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,7 @@ export default function ApiTest({ getService }: FtrProviderContext) {
},
];

// Failing: See https://github.com/elastic/kibana/issues/203408
describe.skip('/api/observability_ai_assistant/chat/complete', function () {
describe('/api/observability_ai_assistant/chat/complete', function () {
// TODO: https://github.com/elastic/kibana/issues/192751
this.tags(['skipMKI']);

Expand Down Expand Up @@ -107,6 +106,7 @@ export default function ApiTest({ getService }: FtrProviderContext) {

await titleSimulator.status(200);
await titleSimulator.next('My generated title');
await titleSimulator.tokenCount({ completion: 1, prompt: 1, total: 2 });
await titleSimulator.complete();

await conversationSimulator.status(200);
Expand Down Expand Up @@ -202,6 +202,7 @@ export default function ApiTest({ getService }: FtrProviderContext) {
},
],
});
await conversationSimulator.tokenCount({ completion: 0, prompt: 0, total: 0 });
await conversationSimulator.complete();
}
);
Expand Down Expand Up @@ -259,6 +260,7 @@ export default function ApiTest({ getService }: FtrProviderContext) {
},
],
});
await conversationSimulator.tokenCount({ completion: 0, prompt: 0, total: 0 });
await conversationSimulator.complete();
}
);
Expand All @@ -275,6 +277,7 @@ export default function ApiTest({ getService }: FtrProviderContext) {
before(async () => {
responseBody = await getOpenAIResponse(async (conversationSimulator) => {
await conversationSimulator.next('Hello');
await conversationSimulator.tokenCount({ completion: 1, prompt: 1, total: 2 });
await conversationSimulator.complete();
});
});
Expand Down
Loading