diff --git a/.gitignore b/.gitignore index 4e1767d..8c81067 100644 --- a/.gitignore +++ b/.gitignore @@ -167,3 +167,7 @@ fabric.properties /.idea/copilot/* ``` + +# Development settings +.devcontainer/ +.vscode/ \ No newline at end of file diff --git a/package.json b/package.json index 719bc2f..72d3f4d 100644 --- a/package.json +++ b/package.json @@ -20,7 +20,7 @@ "test:e2e": "jest --config ./test/jest-e2e.json" }, "dependencies": { - "@azure/openai": "1.0.0-beta.6", + "@azure/openai": "1.0.0-beta.12", "@azure/search-documents": "^12.0.0", "@nestjs/common": "^9.4.3", "@nestjs/config": "^2.3.1", diff --git a/src/message/message.service.ts b/src/message/message.service.ts index 279ecbc..db4db43 100644 --- a/src/message/message.service.ts +++ b/src/message/message.service.ts @@ -5,7 +5,7 @@ import { Message } from './entities/message.entity'; import { Thread } from '../thread/entities/thread.entity'; import { In, Repository } from 'typeorm'; import { InjectRepository } from '@nestjs/typeorm'; -import { ChatMessage } from '@azure/openai'; +import { ChatResponseMessage } from '@azure/openai'; @Injectable() export class MessageService { @@ -30,7 +30,9 @@ export class MessageService { return `This action removes a #${id} message`; } - async findAllMessagesByThreadId(threadId: number): Promise { + async findAllMessagesByThreadId( + threadId: number, + ): Promise { const messages: Message[] = await this.messageRepository.find({ where: { thread: { id: threadId } }, order: { id: 'ASC' }, diff --git a/src/openai/chat-history.service.ts b/src/openai/chat-history.service.ts index 3b70749..5a590ad 100644 --- a/src/openai/chat-history.service.ts +++ b/src/openai/chat-history.service.ts @@ -1,14 +1,14 @@ import { Injectable } from '@nestjs/common'; -import { ChatMessage } from '@azure/openai'; +import { ChatResponseMessage } from '@azure/openai'; import { MessageService } from '../message/message.service'; @Injectable() export class ChatHistoryService { - private chatHistories = new Map(); + private chatHistories = new Map(); constructor(private messageService: MessageService) {} - async initChatHistory(threadId: string): Promise { + async initChatHistory(threadId: string): Promise { if (!this.chatHistories.has(threadId)) { const history = await this.messageService.findAllMessagesByThreadId( +threadId, @@ -18,7 +18,10 @@ export class ChatHistoryService { return this.chatHistories.get(threadId); } - async addMessage(threadId: string, message: ChatMessage): Promise { + async addMessage( + threadId: string, + message: ChatResponseMessage, + ): Promise { // Retrieve the current chat history for the thread const history = this.chatHistories.get(threadId) || []; @@ -37,7 +40,7 @@ export class ChatHistoryService { } } - addSystemMessage(threadId: string, systemMessage: ChatMessage): void { + addSystemMessage(threadId: string, systemMessage: ChatResponseMessage): void { const history = this.chatHistories.get(threadId) || []; history.unshift(systemMessage); // Prepend system message to the chat history @@ -53,7 +56,7 @@ export class ChatHistoryService { this.chatHistories.set(threadId, updatedHistory); } - getChatHistory(threadId: string): ChatMessage[] { + getChatHistory(threadId: string): ChatResponseMessage[] { return this.chatHistories.get(threadId) || []; } } diff --git a/src/openai/openai-chat.service.ts b/src/openai/openai-chat.service.ts index ad0bc1e..a3299ce 100644 --- a/src/openai/openai-chat.service.ts +++ b/src/openai/openai-chat.service.ts @@ -1,15 +1,47 @@ -import { Inject, Injectable, Logger } from '@nestjs/common'; -import { ChatMessage } from '@azure/openai'; +import { Injectable, Logger } from '@nestjs/common'; +import { + ChatResponseMessage, + ChatRequestFunctionMessage, + EventStream, + ChatCompletions, +} from '@azure/openai'; import { MessageService } from '../message/message.service'; import { AzureOpenAIClientService } from './azure-openai-client.service'; import { PluginService } from 'src/plugin'; -import { Message } from '../message/entities/message.entity'; +import { ServerResponse } from 'http'; + +export enum MetadataTagName { + USER_MESSAGE_ID = 'userMessageId', + USER_MESSAGE_CREATED_AT = 'userMessageCreatedAt', + THREAD_ID = 'threadId', + ROLE = 'role', + AI_MESSAGE_ID = 'aiMessageId', + AI_MESSAGE_CREATED_AT = 'aiMessageCreatedAt', +} + +interface MetadataContent { + data: string; + metadataTag: MetadataTagName; +} + +/** + * Writes a sequence of metadata to the server response stream + * @param writableStream server response + * @param dataForChunks metadata to be written + */ +const writeMetadataToStream = ( + writableStream: ServerResponse, + dataForChunks: MetadataContent[], +) => { + for (const dataObj of dataForChunks) { + writableStream.write(`[[${dataObj.metadataTag}=${dataObj.data}]]`); + } +}; @Injectable() export class OpenaiChatService { private readonly logger = new Logger(OpenaiChatService.name); - private readonly gpt35Deployment = 'gpt-35-turbo'; - private readonly gpt4Deployment = 'gpt-4'; + private readonly gpt4_32K_Deployment = 'gpt-4-32k'; constructor( private readonly messageService: MessageService, @@ -17,26 +49,35 @@ export class OpenaiChatService { private readonly pluginService: PluginService, ) {} - // Get the employees professional work experience details based on a given employee name or certificate name or skill name - - //system message - //Query message from user - //funiton informatin - async getChatResponse({ + /** + * Sets and returns what the AI chat responded to the user request + * @param param0 + */ + async getChatResponseStream({ senderName, senderEmail, threadId, plugin, - }): Promise { + writableStream, + userMessageId, + userMessageCreatedAt, + }: { + senderName: string; + senderEmail: string; + threadId: number; + plugin?: string; + writableStream: ServerResponse; + userMessageId: number; + userMessageCreatedAt: string; + }) { // Initialize the message array with existing messages or an empty array - const chatHistory = await this.messageService.findAllMessagesByThreadId( - threadId, - ); + const chatHistory: Array = + await this.messageService.findAllMessagesByThreadId(threadId); try { // Initialize chat session with System message // Generic prompt engineering - const systemMessage: ChatMessage = { + const systemMessage: ChatResponseMessage = { role: 'system', content: `Current Date and Time is ${new Date().toISOString()}. User's name is ${senderName} and user's emailID is ${senderEmail}. @@ -55,8 +96,9 @@ If user just says Hi or how are you to start conversation, you can respond with }; chatHistory.unshift(systemMessage); this.logger.log(`CHAT_HISTORY: ${JSON.stringify(chatHistory)}`); + const completion = await this.azureOpenAIClient.getChatCompletions( - this.gpt4Deployment, + this.gpt4_32K_Deployment, chatHistory, { temperature: 0.1, @@ -65,19 +107,38 @@ If user just says Hi or how are you to start conversation, you can respond with ), }, ); - const initial_response = completion.choices[0].message; - const initial_response_message = await this.messageService.create({ + const initialResponse = completion.choices[0].message; + const initialResponseMessagePromise = this.messageService.create({ threadId, - data: initial_response, + data: initialResponse, }); - chatHistory.push(initial_response); + + chatHistory.push(initialResponse); this.logger.log( `INITIAL_RESPONSE: ${JSON.stringify(completion.choices[0].message)}`, ); - const functionCall = initial_response.functionCall; + + const { functionCall } = initialResponse; this.logger.log(`FUNCTION_CALLING: ${JSON.stringify(functionCall)}`); + + writeMetadataToStream(writableStream, [ + { + data: threadId.toString(), + metadataTag: MetadataTagName.THREAD_ID, + }, + { + data: userMessageId.toString(), + metadataTag: MetadataTagName.USER_MESSAGE_ID, + }, + { + data: new Date(userMessageCreatedAt).toISOString(), + metadataTag: MetadataTagName.USER_MESSAGE_CREATED_AT, + }, + ]); + writableStream.emit('drain'); + if (functionCall && functionCall.name) { - const function_response = await this.pluginService.executeFunction( + const functionResponse = await this.pluginService.executeFunction( functionCall.name, functionCall.arguments, senderEmail, @@ -85,46 +146,103 @@ If user just says Hi or how are you to start conversation, you can respond with const calledFunction = this.pluginService.findDefinition( functionCall.name, ); - // chatHistory.push({ - // role: function_response.role, - // functionCall: { - // name: functionCall.name, - // arguments: function_response.functionCall.arguments, - // }, - // content: '', - // }); - chatHistory.push({ - role: 'function', - name: functionCall.name, - content: function_response.toString() + calledFunction.followUpPrompt, - }); - await this.messageService.create({ + const creationPromise = this.messageService.create({ threadId, data: { role: 'function', name: functionCall.name, content: - function_response.toString() + calledFunction.followUpPrompt, + functionResponse.toString() + calledFunction.followUpPrompt, }, }); + chatHistory.push({ + role: 'function', + name: functionCall.name, + content: functionResponse.toString() + calledFunction.followUpPrompt, + }); + this.logger.debug(`########`); this.logger.debug(chatHistory); - const final_completion = - await this.azureOpenAIClient.getChatCompletions( - calledFunction.followUpModel || this.gpt35Deployment, + + const finalCompletionEventStream: EventStream = + await this.azureOpenAIClient.streamChatCompletions( + calledFunction.followUpModel || this.gpt4_32K_Deployment, chatHistory, { temperature: calledFunction.followUpTemperature || 0 }, ); - const final_response: ChatMessage = final_completion.choices[0].message; - this.logger.log(`final_response Response:`); - this.logger.log(final_response); - chatHistory.push(final_response); - return await this.messageService.create({ + + const NO_CONTENT = ''; + const responseMessage: ChatResponseMessage = { + content: NO_CONTENT, + role: NO_CONTENT, + }; + + for await (const event of finalCompletionEventStream) { + for (let i = 0; i < event.choices.length; i++) { + if (event.choices[i].delta) { + if ( + event.choices[i].delta.role && + responseMessage.role === NO_CONTENT + ) { + writeMetadataToStream(writableStream, [ + { + data: event.choices[i].delta.role, + metadataTag: MetadataTagName.ROLE, + }, + ]); + responseMessage.role = event.choices[i].delta.role; + } + if (event.choices[i].delta.content) { + writableStream.write(event.choices[i].delta.content); + responseMessage.content += event.choices[i].delta.content; + } + if (i % 2 === 0) { + writableStream.emit('drain'); + } + } + } + } + this.logger.log(responseMessage); + // chatHistory.push(responseMessage); + + await creationPromise; + const createdMessage = await this.messageService.create({ threadId, - data: final_response, + data: responseMessage, }); + writeMetadataToStream(writableStream, [ + { + data: createdMessage.id.toString(), + metadataTag: MetadataTagName.AI_MESSAGE_ID, + }, + { + data: new Date(createdMessage.createdAt).toISOString(), + metadataTag: MetadataTagName.AI_MESSAGE_CREATED_AT, + }, + ]); + } else { + this.logger.log('No functionCall'); + + const initialResponseMessage = await initialResponseMessagePromise; + writeMetadataToStream(writableStream, [ + { + data: initialResponseMessage.data.role, + metadataTag: MetadataTagName.ROLE, + }, + ]); + writableStream.write(initialResponseMessage.data.content); + writeMetadataToStream(writableStream, [ + { + data: initialResponseMessage.id.toString(), + metadataTag: MetadataTagName.AI_MESSAGE_ID, + }, + { + data: new Date(initialResponseMessage.createdAt).toISOString(), + metadataTag: MetadataTagName.AI_MESSAGE_CREATED_AT, + }, + ]); } - return initial_response_message; + writableStream.end(); } catch (error) { this.logger.log(error); throw error; diff --git a/src/openai/openai.service.ts b/src/openai/openai.service.ts index 5d79568..9aa80b7 100644 --- a/src/openai/openai.service.ts +++ b/src/openai/openai.service.ts @@ -1,7 +1,8 @@ import { Injectable, Logger } from '@nestjs/common'; import { ChatCompletions, - ChatMessage, + ChatResponseMessage, + ChatRequestFunctionMessage, Completions, FunctionDefinition, } from '@azure/openai'; @@ -38,14 +39,14 @@ export class OpenaiService { ]; // Initialize the message array with existing messages or an empty array - const messages: ChatMessage[] = + const messages: Array = this.bufferMemoryService.getMessages(senderEmail); try { if (messages.length === 0) { // Initialize chat session with System message // Generic prompt engineering - const systemMessage: ChatMessage = { + const systemMessage: ChatResponseMessage = { role: 'system', content: `Current Date and Time is ${new Date().toISOString()}. User's name is ${senderName} and user's emailID is ${senderEmail}. @@ -65,7 +66,7 @@ If user just says Hi or how are you to start conversation, you can respond with messages.push(systemMessage); } // Add the new user message to the buffer - const userMessage: ChatMessage = { + const userMessage: ChatResponseMessage = { role: 'user', content: message, }; @@ -443,7 +444,7 @@ If user just says Hi or how are you to start conversation, you can respond with // Call OpenAI's Chat completions for string async getChatCompletions( - messages: ChatMessage[], + messages: ChatResponseMessage[], options: { temperature: number }, ): Promise { return this.azureOpenAIClient.getChatCompletions( diff --git a/src/plugin/plugins/cv.plugin.ts b/src/plugin/plugins/cv.plugin.ts index 3bc9b54..b2d1f97 100644 --- a/src/plugin/plugins/cv.plugin.ts +++ b/src/plugin/plugins/cv.plugin.ts @@ -13,7 +13,7 @@ export class CVsPlugin { constructor( private readonly configService: ConfigService, private readonly cognitiveSearchService: CognitiveSearchService, - ) {} + ) { } @Definition({ description: `Get the employees professional work experience context/details from Vector Database`, @@ -34,7 +34,7 @@ export class CVsPlugin { Look at user question and look at employee work experience above see if you can find answer from above context, if you don't find answer within context, say it do not know the answer.`, followUpTemperature: 0.7, - followUpModel: 'gpt-4', + followUpModel: 'gpt-35-turbo-16k', }) private async getEmployeesWorkDetails({ completeUserMessage, diff --git a/src/thread/thread.controller.ts b/src/thread/thread.controller.ts index da42b09..b1afd17 100644 --- a/src/thread/thread.controller.ts +++ b/src/thread/thread.controller.ts @@ -20,6 +20,8 @@ import { GoogleTokenGuard } from 'src/auth/guards/google-token.guard'; import { ConfigService } from '@nestjs/config'; import { Thread } from './entities/thread.entity'; import { OpenaiChatService } from '../openai/openai-chat.service'; +import { Res } from '@nestjs/common/decorators'; +import { ServerResponse } from 'http'; @UseGuards(GoogleTokenGuard) @Controller('thread') @@ -33,28 +35,39 @@ export class ThreadController { ) {} @Post() - async create(@Request() req, @Body() createThreadDto: CreateThreadDto) { + async create( + @Request() req, + @Res() res: ServerResponse, + @Body() createThreadDto: CreateThreadDto, + ) { createThreadDto.user = req.user; + const thread: Thread = await this.threadService.create(createThreadDto); this.logger.log(`Created thread: ${JSON.stringify(thread)}`); // Calling Model to get response - const chatMessage = createThreadDto.message; + const chatMessage = createThreadDto.message.trim(); + if (chatMessage.length === 0) { + throw new HttpException('No message was sent', HttpStatus.BAD_REQUEST); + } const senderName = req.user.name; const senderEmail = req.user.username; this.logger.log( `NAME:${senderName}, CHAT_MESSAGE:${chatMessage}, SENDER_EMAIL: ${senderEmail}`, ); - await this.OpenaiChatService.getChatResponse({ + + this.OpenaiChatService.getChatResponseStream({ senderName, senderEmail, threadId: thread.id, plugin: thread.plugin, + writableStream: res, + userMessageId: thread.messages[0].id, + userMessageCreatedAt: new Date(thread.createdAt).toISOString(), }); - return { - ...thread, - messages: await this.messageService.findChatMessagesByThreadId(thread.id), - }; + + // stream of strings with the AI's response data and metadata + return res; } @Get() @@ -84,8 +97,9 @@ export class ThreadController { } @Post(':threadId/messages') - async addMessageToThread( + async addMessageToThreadAndStream( @Request() req, + @Res() res: ServerResponse, @Param('threadId') threadId: string, @Body() messageContent: any, ) { @@ -103,31 +117,38 @@ export class ThreadController { HttpStatus.TOO_MANY_REQUESTS, ); } - await this.messageService.create({ + + const chatMessage = messageContent.text.trim(); + if (chatMessage.length === 0) { + throw new HttpException('No message was sent', HttpStatus.BAD_REQUEST); + } + const userMessage = await this.messageService.create({ threadId: +threadId, data: { role: 'user', - content: messageContent.text, + content: chatMessage, }, }); const thread = await this.threadService.findOne(+threadId); - const chatMessage = messageContent.text; + const senderName = req.user.name; const senderEmail = req.user.username; this.logger.log( `NAME:${senderName}, CHAT_MESSAGE:${chatMessage}, SENDER_EMAIL: ${senderEmail}`, ); - const reply = await this.OpenaiChatService.getChatResponse({ + + this.OpenaiChatService.getChatResponseStream({ senderName, senderEmail, - threadId, + threadId: thread.id, plugin: thread.plugin, + writableStream: res, + userMessageId: userMessage.id, + userMessageCreatedAt: new Date(userMessage.createdAt).toISOString(), }); - return { - id: reply.id, - data: reply.data, - }; + // stream of strings with the AI's response data and metadata + return res; } } diff --git a/src/utils/buffer-memory/buffer-memory.service.ts b/src/utils/buffer-memory/buffer-memory.service.ts index 252e9b3..1f73290 100644 --- a/src/utils/buffer-memory/buffer-memory.service.ts +++ b/src/utils/buffer-memory/buffer-memory.service.ts @@ -1,10 +1,10 @@ import { Injectable, Logger } from '@nestjs/common'; -import { ChatMessage, FunctionDefinition } from '@azure/openai'; +import { ChatResponseMessage, FunctionDefinition } from '@azure/openai'; import { SchedulerRegistry } from '@nestjs/schedule'; @Injectable() export class BufferMemoryService { - private buffer: Map = new Map(); + private buffer: Map = new Map(); private readonly expiryTime: number = 10 * 60 * 60 * 1000; // 10 hours in milliseconds private readonly logger = new Logger(BufferMemoryService.name); @@ -54,7 +54,7 @@ export class BufferMemoryService { } } - addMessage(email: string, message: ChatMessage): void { + addMessage(email: string, message: ChatResponseMessage): void { this.logger.log(`Adding message for email: ${email}`); const messages = this.buffer.get(email) || []; messages.push(message); @@ -68,7 +68,7 @@ export class BufferMemoryService { ); } - addMessages(email: string, messagesToAdd: ChatMessage[]): void { + addMessages(email: string, messagesToAdd: ChatResponseMessage[]): void { this.logger.log(`Adding multiple messages for email: ${email}`); const messages = this.buffer.get(email) || []; messages.push(...messagesToAdd); @@ -82,7 +82,7 @@ export class BufferMemoryService { ); } - getMessages(email: string): ChatMessage[] { + getMessages(email: string): ChatResponseMessage[] { this.logger.log(`Retrieving messages for email: ${email}`); const messages = this.buffer.get(email) || []; this.setExpiry(email); // Refresh the expiry diff --git a/yarn.lock b/yarn.lock index 4e4a18d..05e81e2 100644 --- a/yarn.lock +++ b/yarn.lock @@ -64,17 +64,17 @@ node-fetch "^2.6.7" web-streams-polyfill "^3.2.1" -"@azure-rest/core-client@^1.1.4": - version "1.1.7" - resolved "https://registry.npmjs.org/@azure-rest/core-client/-/core-client-1.1.7.tgz" - integrity sha512-eQdtieYrOfRwsHFuz6vNANpOT567456m8/CpE3cqdVQgLMrn1uua5O8nLS/XN727MsbTgiZP6C0rAkupt3ky7Q== +"@azure-rest/core-client@^1.1.7": + version "1.4.0" + resolved "https://registry.yarnpkg.com/@azure-rest/core-client/-/core-client-1.4.0.tgz#3be28c02c6c20e49dea73a7f012daeeda4eacb8e" + integrity sha512-ozTDPBVUDR5eOnMIwhggbnVmOrka4fXCs8n8mvUo4WLLc38kki6bAOByDoVZZPz/pZy2jMt2kwfpvy/UjALj6w== dependencies: - "@azure/abort-controller" "^1.1.0" + "@azure/abort-controller" "^2.0.0" "@azure/core-auth" "^1.3.0" "@azure/core-rest-pipeline" "^1.5.0" "@azure/core-tracing" "^1.0.1" "@azure/core-util" "^1.0.0" - tslib "^2.2.0" + tslib "^2.6.2" "@azure/abort-controller@^1.0.0", "@azure/abort-controller@^1.0.4", "@azure/abort-controller@^1.1.0": version "1.1.0" @@ -83,6 +83,13 @@ dependencies: tslib "^2.2.0" +"@azure/abort-controller@^2.0.0": + version "2.1.2" + resolved "https://registry.yarnpkg.com/@azure/abort-controller/-/abort-controller-2.1.2.tgz#42fe0ccab23841d9905812c58f1082d27784566d" + integrity sha512-nBrLsEWm4J2u5LpAPjxADTlq3trDgVZZXHNKabeXZtpq3d3AbN/KGO82R87rdDz5/lYB024rtEf10/q0urNgsA== + dependencies: + tslib "^2.6.2" + "@azure/core-auth@^1.3.0", "@azure/core-auth@^1.4.0": version "1.5.0" resolved "https://registry.npmjs.org/@azure/core-auth/-/core-auth-1.5.0.tgz" @@ -114,16 +121,6 @@ "@azure/core-client" "^1.3.0" "@azure/core-rest-pipeline" "^1.3.0" -"@azure/core-lro@^2.5.3": - version "2.5.4" - resolved "https://registry.npmjs.org/@azure/core-lro/-/core-lro-2.5.4.tgz" - integrity sha512-3GJiMVH7/10bulzOKGrrLeG/uCBH/9VtxqaMcB9lIqAeamI/xYQSHJL/KcsLDuH+yTjYpro/u6D/MuRe4dN70Q== - dependencies: - "@azure/abort-controller" "^1.0.0" - "@azure/core-util" "^1.2.0" - "@azure/logger" "^1.0.0" - tslib "^2.2.0" - "@azure/core-paging@^1.1.1": version "1.5.0" resolved "https://registry.npmjs.org/@azure/core-paging/-/core-paging-1.5.0.tgz" @@ -131,7 +128,21 @@ dependencies: tslib "^2.2.0" -"@azure/core-rest-pipeline@^1.10.2", "@azure/core-rest-pipeline@^1.3.0", "@azure/core-rest-pipeline@^1.5.0", "@azure/core-rest-pipeline@^1.9.1": +"@azure/core-rest-pipeline@^1.13.0": + version "1.15.2" + resolved "https://registry.yarnpkg.com/@azure/core-rest-pipeline/-/core-rest-pipeline-1.15.2.tgz#421729bbd8cd5f9f50b403e79941f27ac1bdc302" + integrity sha512-BmWfpjc/QXc2ipHOh6LbUzp3ONCaa6xzIssTU0DwH9bbYNXJlGUL6tujx5TrbVd/QQknmS+vlQJGrCq2oL1gZA== + dependencies: + "@azure/abort-controller" "^2.0.0" + "@azure/core-auth" "^1.4.0" + "@azure/core-tracing" "^1.0.1" + "@azure/core-util" "^1.3.0" + "@azure/logger" "^1.0.0" + http-proxy-agent "^7.0.0" + https-proxy-agent "^7.0.0" + tslib "^2.6.2" + +"@azure/core-rest-pipeline@^1.3.0", "@azure/core-rest-pipeline@^1.5.0", "@azure/core-rest-pipeline@^1.9.1": version "1.13.0" resolved "https://registry.npmjs.org/@azure/core-rest-pipeline/-/core-rest-pipeline-1.13.0.tgz" integrity sha512-a62aP/wppgmnfIkJLfcB4ssPBcH94WzrzPVJ3tlJt050zX4lfmtnvy95D3igDo3f31StO+9BgPrzvkj4aOxnoA== @@ -145,12 +156,12 @@ https-proxy-agent "^5.0.0" tslib "^2.2.0" -"@azure/core-sse@^1.0.0": - version "1.0.0" - resolved "https://registry.npmjs.org/@azure/core-sse/-/core-sse-1.0.0.tgz" - integrity sha512-UhsxgWrQaIh6rJynDCNHYDbJ1b3bmqaOex4so8+h0UL4mxyb/og2FHoDJPzgLlvtM4b6/d/klBpwltsxHaZgNA== +"@azure/core-sse@^2.0.0": + version "2.1.2" + resolved "https://registry.yarnpkg.com/@azure/core-sse/-/core-sse-2.1.2.tgz#bbd3c983d123bccd68d618a73e2980c78c2b56ee" + integrity sha512-yf+pFIu8yCzXu9RbH2+8kp9vITIKJLHgkLgFNA6hxiDHK3fxeP596cHUj4c8Cm8JlooaUnYdHmF84KCZt3jbmw== dependencies: - tslib "^2.4.0" + tslib "^2.6.2" "@azure/core-tracing@^1.0.0", "@azure/core-tracing@^1.0.1": version "1.0.1" @@ -159,7 +170,7 @@ dependencies: tslib "^2.2.0" -"@azure/core-util@^1.0.0", "@azure/core-util@^1.1.0", "@azure/core-util@^1.2.0", "@azure/core-util@^1.3.0": +"@azure/core-util@^1.0.0", "@azure/core-util@^1.1.0", "@azure/core-util@^1.3.0": version "1.6.1" resolved "https://registry.npmjs.org/@azure/core-util/-/core-util-1.6.1.tgz" integrity sha512-h5taHeySlsV9qxuK64KZxy4iln1BtMYlNt5jbuEFN3UFSAd1EwKg/Gjl5a6tZ/W8t6li3xPnutOx7zbDyXnPmQ== @@ -167,6 +178,14 @@ "@azure/abort-controller" "^1.0.0" tslib "^2.2.0" +"@azure/core-util@^1.4.0": + version "1.9.0" + resolved "https://registry.yarnpkg.com/@azure/core-util/-/core-util-1.9.0.tgz#469afd7e6452d5388b189f90d33f7756b0b210d1" + integrity sha512-AfalUQ1ZppaKuxPPMsFEUdX6GZPB3d9paR9d/TTL7Ow2De8cJaC7ibi7kWVlFAVPCYo31OcnGymc0R89DX8Oaw== + dependencies: + "@azure/abort-controller" "^2.0.0" + tslib "^2.6.2" + "@azure/logger@^1.0.0", "@azure/logger@^1.0.3": version "1.0.4" resolved "https://registry.npmjs.org/@azure/logger/-/logger-1.0.4.tgz" @@ -174,19 +193,17 @@ dependencies: tslib "^2.2.0" -"@azure/openai@1.0.0-beta.6": - version "1.0.0-beta.6" - resolved "https://registry.npmjs.org/@azure/openai/-/openai-1.0.0-beta.6.tgz" - integrity sha512-RyM6Gi5AQyhOU/dDj2yC6cVQun6Z2cK+Z5wHpxR7tI3S980R9xhaqRtCGYPxwxlqCW34wabQcPPLthgAlYyRHA== +"@azure/openai@1.0.0-beta.12": + version "1.0.0-beta.12" + resolved "https://registry.yarnpkg.com/@azure/openai/-/openai-1.0.0-beta.12.tgz#b1467a19c1dc015c59e2eb6f821beb3faf1caa10" + integrity sha512-qKblxr6oVa8GsyNzY+/Ub9VmEsPYKhBrUrPaNEQiM+qrxnBPVm9kaeqGFFb/U78Q2zOabmhF9ctYt3xBW0nWnQ== dependencies: - "@azure-rest/core-client" "^1.1.4" + "@azure-rest/core-client" "^1.1.7" "@azure/core-auth" "^1.4.0" - "@azure/core-lro" "^2.5.3" - "@azure/core-rest-pipeline" "^1.10.2" - "@azure/core-sse" "^1.0.0" + "@azure/core-rest-pipeline" "^1.13.0" + "@azure/core-sse" "^2.0.0" + "@azure/core-util" "^1.4.0" "@azure/logger" "^1.0.3" - form-data-encoder "1.7.2" - formdata-node "^4.0.0" tslib "^2.4.0" "@azure/search-documents@^12.0.0": @@ -1692,6 +1709,13 @@ agent-base@^7.0.2: dependencies: debug "^4.3.4" +agent-base@^7.1.0: + version "7.1.1" + resolved "https://registry.yarnpkg.com/agent-base/-/agent-base-7.1.1.tgz#bdbded7dfb096b751a2a087eeeb9664725b2e317" + integrity sha512-H0TSyFNDMomMNJQBn8wFV5YC/2eJ+VXECwOadZJT554xP6cODZHPX3H9QMQECxvrgiSOP1pHjy1sMWQVYJOUOA== + dependencies: + debug "^4.3.4" + agentkeepalive@^4.2.1: version "4.5.0" resolved "https://registry.npmjs.org/agentkeepalive/-/agentkeepalive-4.5.0.tgz" @@ -3190,7 +3214,7 @@ form-data@^4.0.0: combined-stream "^1.0.8" mime-types "^2.1.12" -formdata-node@^4.0.0, formdata-node@^4.3.2: +formdata-node@^4.3.2: version "4.4.1" resolved "https://registry.npmjs.org/formdata-node/-/formdata-node-4.4.1.tgz" integrity sha512-0iirZp3uVDjVGt9p49aTaqjk84TrglENEDuqfdlZQ1roC9CWlPk6Avf8EEnZNcAqPonwkG35x4n3ww/1THYAeQ== @@ -3588,6 +3612,14 @@ http-proxy-agent@^5.0.0: agent-base "6" debug "4" +http-proxy-agent@^7.0.0: + version "7.0.2" + resolved "https://registry.yarnpkg.com/http-proxy-agent/-/http-proxy-agent-7.0.2.tgz#9a8b1f246866c028509486585f62b8f2c18c270e" + integrity sha512-T1gkAiYYDWYx3V5Bmyu7HcfcvL7mUrTWiM6yOfa3PIphViJ/gFPbvidQ+veqSOHci/PxBcDabeUNCzpOODJZig== + dependencies: + agent-base "^7.1.0" + debug "^4.3.4" + http-signature@~1.3.1: version "1.3.6" resolved "https://registry.npmjs.org/http-signature/-/http-signature-1.3.6.tgz" @@ -3605,6 +3637,14 @@ https-proxy-agent@^5.0.0: agent-base "6" debug "4" +https-proxy-agent@^7.0.0: + version "7.0.4" + resolved "https://registry.yarnpkg.com/https-proxy-agent/-/https-proxy-agent-7.0.4.tgz#8e97b841a029ad8ddc8731f26595bad868cb4168" + integrity sha512-wlwpilI7YdjSkWaQ/7omYBMTliDcmCN8OLihO6I9B86g06lMyAoqgoDpV0XqoaPOKj+0DIdAvnsWfyAAhmimcg== + dependencies: + agent-base "^7.0.2" + debug "4" + https-proxy-agent@^7.0.1: version "7.0.2" resolved "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-7.0.2.tgz" @@ -6328,7 +6368,7 @@ tslib@^1.8.1: resolved "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz" integrity sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg== -tslib@^2.1.0, tslib@^2.2.0, tslib@^2.4.0, tslib@^2.5.0: +tslib@^2.1.0, tslib@^2.2.0, tslib@^2.4.0, tslib@^2.5.0, tslib@^2.6.2: version "2.6.2" resolved "https://registry.npmjs.org/tslib/-/tslib-2.6.2.tgz" integrity sha512-AEYxH93jGFPn/a2iVAwW87VuUIkR1FVUKB77NwMF7nBTDkDrrT/Hpt/IrCJ0QXhW27jTBDcf5ZY7w6RiqTMw2Q==