Skip to content

Commit

Permalink
Refactor knowledge_base_user_instructions tests to use interceptPromi…
Browse files Browse the repository at this point in the history
…ses for conversation interception
  • Loading branch information
arturoliduena committed Jan 10, 2025
1 parent fa9e3cc commit 9e37305
Showing 1 changed file with 7 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,10 @@ export default function ApiTest({ getService }: DeploymentAgnosticFtrProviderCon

expect(status).to.be(200);

const interceptPromises = proxy
.interceptConversation({ name: 'conversation', response: 'I, the LLM, hear you!' })
.completeAfterIntercept();

const messages: Message[] = [
{
'@timestamp': new Date().toISOString(),
Expand Down Expand Up @@ -274,9 +278,7 @@ export default function ApiTest({ getService }: DeploymentAgnosticFtrProviderCon
},
});

await proxy
.interceptConversation({ name: 'conversation', response: 'I, the LLM, hear you!' })
.completeAfterIntercept();
await interceptPromises;

const conversation = res.body;
return conversation;
Expand All @@ -291,6 +293,8 @@ export default function ApiTest({ getService }: DeploymentAgnosticFtrProviderCon

after(async () => {
proxy.close();
await clearKnowledgeBase(es);
await clearConversations(es);
await observabilityAIAssistantAPIClient.deleteActionConnector({
actionId: connectorId,
});
Expand Down

0 comments on commit 9e37305

Please sign in to comment.