Skip to content

Commit

Permalink
test: Fixed two assertions to work against older versions of openai (
Browse files Browse the repository at this point in the history
  • Loading branch information
bizob2828 authored Nov 12, 2024
1 parent 64fb1dc commit 8996fc3
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
9 changes: 5 additions & 4 deletions test/versioned/openai/chat-completions.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -360,10 +360,11 @@ if (semver.gte(pkgVersion, '4.12.2')) {
const events = agent.customEventAggregator.events.toArray()
assert.equal(events.length, 0)
// we will still record the external segment but not the chat completion
assertSegments(tx.trace.root, [
'timers.setTimeout',
`External/${host}:${port}/chat/completions`
])
assertSegments(
tx.trace.root,
['timers.setTimeout', `External/${host}:${port}/chat/completions`],
{ exact: false }
)

tx.end()
end()
Expand Down
2 changes: 1 addition & 1 deletion test/versioned/openai/embeddings.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ test('embedding invalid payload errors should be tracked', (t, end) => {
},
customAttributes: {
'http.statusCode': 403,
'error.message': '403 You are not allowed to generate embeddings from this model',
'error.message': /You are not allowed to generate embeddings from this model/,
'error.code': null,
'error.param': null,
'completion_id': undefined,
Expand Down

0 comments on commit 8996fc3

Please sign in to comment.