Closed nume-kudi closed 3 months ago
@nnkkd Thank you for using the Azure OpenAI Assistants SDK, and for writing this issue up. For the JS Azure SDK, our standard naming policy for properties like fileId and messageId is camel case, as opposed to the snake case used in the official OpenAI Node library. We opted for consistency within the JS Azure SDK instead of consistency with that external API. Does that make sense?
@glharper I understand the importance of maintaining consistency in naming conventions. However, the issue arises from the fact that some property names do not maintain this consistency internally. As a result, following the SDK's type definitions leads to always retrieving undefined, and users cannot realize the mismatch in types until they perform console outputs.
For instance, the actual RunStep object is as follows:
{
id: 'step_2PbBOaWx3bXKseIxYGRVR3QJ',
object: 'thread.run.step',
type: 'message_creation',
status: 'completed',
usage: { promptTokens: 498, completionTokens: 27, totalTokens: 525 },
runId: 'run_kGMxicgga9htGBxhHLAj2oDc',
assistantId: 'asst_jZzGZiRcBsMntpHQBEkOIXNi',
threadId: 'thread_r1bRylSX3TYoUzN85CS4jbbM',
expiresAt: null,
stepDetails: {
type: 'message_creation',
messageCreation: { message_id: 'msg_72rPSkVULBzwU3VKK6nvu9ex' },
toolCalls: []
},
lastError: null,
createdAt: 2024-04-09T23:39:06.000Z,
expiredAt: Invalid Date,
completedAt: 2024-04-09T23:39:08.000Z,
cancelledAt: null,
failedAt: null
}
Hi @nume-kudi, we strongly recommend that you migrate to use the AzureOpenAI
client exported by the official OpenAI client library for JavaScript. Checkout the migration guide for how to do so while maintaining typing for Azure features.
Please let us know if you have any other questions!
Describe the bug Within the MessageImageFileDetails interface, the property named fileId does not match the expected API property file_id.
Similarly, in the RunStepMessageCreationReference interface, the property named messageId is inaccurately named. According to the expected API property, it should be message_id.
To Reproduce Steps to reproduce the behavior:
Expected behavior Should be able to correctly access file_id or message_id.
Additional context The AssistantsClient is using API version 2024-03-01-preview