Skip to content

Commit

Permalink
fix: mistral ai model conditional
Browse files Browse the repository at this point in the history
  • Loading branch information
yiyuan-he committed Nov 8, 2024
1 parent a3355ea commit c25d7de
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,7 @@ export class BedrockRuntimeServiceExtension implements ServiceExtension {
if (requestBody.top_p !== undefined) {
spanAttributes[AwsSpanProcessingUtil.GEN_AI_REQUEST_TOP_P] = requestBody.top_p;
}
} else if (modelId.includes('mistral.mistral')) {
} else if (modelId.includes('mistral')) {
if (requestBody.prompt !== undefined) {
// NOTE: We approximate the token count since this value is not directly available in the body
// According to Bedrock docs they use (total_chars / 6) to approximate token count for pricing.
Expand Down Expand Up @@ -386,7 +386,7 @@ export class BedrockRuntimeServiceExtension implements ServiceExtension {
responseBody.choices[0].finish_reason,
]);
}
} else if (currentModelId.includes('mistral.mistral')) {
} else if (currentModelId.includes('mistral')) {
if (responseBody.outputs?.[0]?.text !== undefined) {
span.setAttribute(
AwsSpanProcessingUtil.GEN_AI_USAGE_OUTPUT_TOKENS,
Expand Down

0 comments on commit c25d7de

Please sign in to comment.