Skip to content

Commit

Permalink
Implement Agent streaming with test and samples (#31696)
Browse files Browse the repository at this point in the history
Two new streaming API for Running Agents.
` createRunStreaming: (threadId: string, assistantId: string, options?:
Omit<CreateRunOptions, "assistant_id">, requestParams?:
RequestParameters) => AsyncIterable<AgentStreamEventMessage>; `

`createThreadAndRunStreaming: (assistantId: string, options?:
Omit<CreateAndRunThreadOptions, "assistant_id">, requestParams?:
RequestParameters) `

Leverage Azure Core SSE package for streaming.

This also brings in some models omitted by the JS code gen, necessary
for streaming.
  • Loading branch information
ganeshyb authored Nov 11, 2024
1 parent f37382a commit 8aeb475
Show file tree
Hide file tree
Showing 11 changed files with 2,570 additions and 213 deletions.
8 changes: 5 additions & 3 deletions sdk/ai/ai-projects/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,11 @@
"@azure-rest/core-client": "^2.1.0",
"@azure/core-auth": "^1.6.0",
"@azure/core-rest-pipeline": "^1.5.0",
"@azure/logger": "^1.0.0",
"@azure/core-util": "^1.9.0",
"@azure/logger": "^1.1.4",
"tslib": "^2.6.2",
"@azure/core-paging": "^1.5.0"
"@azure/core-paging": "^1.5.0",
"@azure/core-sse": "^2.1.3"
},
"devDependencies": {
"@azure/dev-tool": "^1.0.0",
Expand Down Expand Up @@ -91,7 +93,7 @@
"audit": "node ../../../common/scripts/rush-audit.js && rimraf node_modules package-lock.json && npm i --package-lock-only 2>&1 && npm audit",
"build:samples": "echo skipped",
"check-format": "dev-tool run vendored prettier --list-different --config ../../../.prettierrc.json --ignore-path ../../../.prettierignore \"src/**/*.{ts,cts,mts}\" \"test/**/*.{ts,cts,mts}\" \"*.{js,cjs,mjs,json}\" ",
"execute:samples": "echo skipped",
"execute:samples": "dev-tool samples run samples-dev",
"format": "dev-tool run vendored prettier --write --config ../../../.prettierrc.json --ignore-path ../../../.prettierignore \"src/**/*.{ts,cts,mts}\" \"test/**/*.{ts,cts,mts}\" \"*.{js,cjs,mjs,json}\" ",
"integration-test": "npm run integration-test:node && npm run integration-test:browser",
"integration-test:browser": "dev-tool run build-package && dev-tool run build-test && dev-tool run test:vitest --no-test-proxy --browser",
Expand Down
Loading

0 comments on commit 8aeb475

Please sign in to comment.