Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added usage models for run and runStep #28864

Conversation

jpalvarezl
Copy link
Member

While implementing streaming in Java, I noticed in the JSON that there is usage data available that we could be deserializing. Maybe this is not the right PR to address this so feel free to ignore for now :)

Reference lines in swagger:

Copy link

openapi-pipeline-app bot commented Apr 26, 2024

Next Steps to Merge

✅ All automated merging requirements have been met! To get your PR merged, see aka.ms/azsdk/specreview/merge.

Copy link

openapi-pipeline-app bot commented Apr 26, 2024

Swagger Validation Report

️️✔️BreakingChange succeeded [Detail] [Expand]
There are no breaking changes.
️️✔️Breaking Change(Cross-Version) succeeded [Detail] [Expand]
There are no breaking changes.
️️✔️LintDiff succeeded [Detail] [Expand]
Validation passes for LintDiff.
️️✔️Avocado succeeded [Detail] [Expand]
Validation passes for Avocado.
️️✔️SwaggerAPIView succeeded [Detail] [Expand]
️️✔️TypeSpecAPIView succeeded [Detail] [Expand]
️️✔️ModelValidation succeeded [Detail] [Expand]
Validation passes for ModelValidation.
️️✔️SemanticValidation succeeded [Detail] [Expand]
Validation passes for SemanticValidation.
️️✔️SpellCheck succeeded [Detail] [Expand]
Validation passes for SpellCheck.
️️✔️PR Summary succeeded [Detail] [Expand]
Validation passes for Summary.
️️✔️Automated merging requirements met succeeded [Detail] [Expand]
Posted by Swagger Pipeline | How to fix these errors?

Copy link

openapi-pipeline-app bot commented Apr 26, 2024

Swagger Generation Artifacts

️️✔️ApiDocPreview succeeded [Detail] [Expand]
️❌ azure-sdk-for-net-track2 failed [Detail]
  • Failed in generating from d1f66de. SDK Automation 14.0.0
    command	pwsh ./eng/scripts/Automation-Sdk-Init.ps1 ../azure-sdk-for-net_tmp/initInput.json ../azure-sdk-for-net_tmp/initOutput.json
    command	pwsh ./eng/scripts/Invoke-GenerateAndBuildV2.ps1 ../azure-sdk-for-net_tmp/generateInput.json ../azure-sdk-for-net_tmp/generateOutput.json
    cmderr	[Invoke-GenerateAndBuildV2.ps1] GeneratePackage: /mnt/vss/_work/1/s/azure-sdk-for-net/eng/scripts/Invoke-GenerateAndBuildV2.ps1:131
    cmderr	[Invoke-GenerateAndBuildV2.ps1] Line |
    cmderr	[Invoke-GenerateAndBuildV2.ps1]  131 |                GeneratePackage `
    cmderr	[Invoke-GenerateAndBuildV2.ps1]      |                ~~~~~~~~~~~~~~~~~
    cmderr	[Invoke-GenerateAndBuildV2.ps1]      | Failed to build sdk. exit code: False
    cmderr	[Invoke-GenerateAndBuildV2.ps1] GeneratePackage: /mnt/vss/_work/1/s/azure-sdk-for-net/eng/scripts/Invoke-GenerateAndBuildV2.ps1:131
    cmderr	[Invoke-GenerateAndBuildV2.ps1] Line |
    cmderr	[Invoke-GenerateAndBuildV2.ps1]  131 |                GeneratePackage `
    cmderr	[Invoke-GenerateAndBuildV2.ps1]      |                ~~~~~~~~~~~~~~~~~
    cmderr	[Invoke-GenerateAndBuildV2.ps1]      | Failed to packe sdk. exit code: False
    cmderr	[Invoke-GenerateAndBuildV2.ps1] Get-ChildItem: /mnt/vss/_work/1/s/azure-sdk-for-net/eng/scripts/automation/GenerateAndBuildLib.ps1:807
    cmderr	[Invoke-GenerateAndBuildV2.ps1] Line |
    cmderr	[Invoke-GenerateAndBuildV2.ps1]  807 |  … rtifacts += Get-ChildItem $artifactsPath -Filter *.nupkg -exclude *.s …
    cmderr	[Invoke-GenerateAndBuildV2.ps1]      |                ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    cmderr	[Invoke-GenerateAndBuildV2.ps1]      | Cannot find path
    cmderr	[Invoke-GenerateAndBuildV2.ps1]      | '/mnt/vss/_work/1/s/azure-sdk-for-net/artifacts/packages/Debug/' because
    cmderr	[Invoke-GenerateAndBuildV2.ps1]      | it does not exist.
    cmderr	[Invoke-GenerateAndBuildV2.ps1] GeneratePackage: /mnt/vss/_work/1/s/azure-sdk-for-net/eng/scripts/Invoke-GenerateAndBuildV2.ps1:131
    cmderr	[Invoke-GenerateAndBuildV2.ps1] Line |
    cmderr	[Invoke-GenerateAndBuildV2.ps1]  131 |                GeneratePackage `
    cmderr	[Invoke-GenerateAndBuildV2.ps1]      |                ~~~~~~~~~~~~~~~~~
    cmderr	[Invoke-GenerateAndBuildV2.ps1]      | Failed to generate sdk artifact
  • Azure.AI.OpenAI.Assistants [Preview SDK Changes]
    info	[Changelog]
️❌ azure-sdk-for-java failed [Detail]
  • Failed in generating from d1f66de. SDK Automation 14.0.0
    command	./eng/mgmt/automation/init.sh ../azure-sdk-for-java_tmp/initInput.json ../azure-sdk-for-java_tmp/initOutput.json
    cmderr	[init.sh]  notice
    cmderr	[init.sh] npm notice New minor version of npm available! 10.5.0 -> 10.6.0
    cmderr	[init.sh] npm notice Changelog: <https://github.com/npm/cli/releases/tag/v10.6.0>
    cmderr	[init.sh] npm notice Run `npm install -g npm@10.6.0` to update!
    cmderr	[init.sh] npm notice
    command	./eng/mgmt/automation/generate.py ../azure-sdk-for-java_tmp/generateInput.json ../azure-sdk-for-java_tmp/generateOutput.json
  • azure-ai-openai-assistants [Preview SDK Changes]
    • pom.xml
️❌ azure-sdk-for-js failed [Detail]
  • Failed in generating from d1f66de. SDK Automation 14.0.0
    command	sh .scripts/automation_init.sh ../azure-sdk-for-js_tmp/initInput.json ../azure-sdk-for-js_tmp/initOutput.json
    warn	File azure-sdk-for-js_tmp/initOutput.json not found to read
    command	sh .scripts/automation_generate.sh ../azure-sdk-for-js_tmp/generateInput.json ../azure-sdk-for-js_tmp/generateOutput.json
    cmderr	[automation_generate.sh] [ERROR] Error:
    cmderr	[automation_generate.sh] [ERROR] An error occurred while run build for typespec project: "specification/ai/OpenAI.Assistants":
    cmderr	[automation_generate.sh] [ERROR] Err: Error: Command failed: rush build -t @azure/openai
    cmderr	[automation_generate.sh] [ERROR] Stderr: "null"
    cmderr	[automation_generate.sh] [ERROR] Stdout: "null"
    cmderr	[automation_generate.sh] [ERROR] ErrorStack: "Error: Command failed: rush build -t @azure/openai
    cmderr	[automation_generate.sh] [ERROR]     at checkExecSyncError (node:child_process:885:11)
    cmderr	[automation_generate.sh] [ERROR]     at Object.execSync (node:child_process:957:15)
    cmderr	[automation_generate.sh] [ERROR]     at Object.<anonymous> (/home/cloudtest/.nvm/versions/node/v18.15.0/lib/node_modules/@azure-tools/js-sdk-release-tools/dist/llc/generateRLCInPipeline/generateRLCInPipeline.js:209:29)
    cmderr	[automation_generate.sh] [ERROR]     at Generator.next (<anonymous>)
    cmderr	[automation_generate.sh] [ERROR]     at fulfilled (/home/cloudtest/.nvm/versions/node/v18.15.0/lib/node_modules/@azure-tools/js-sdk-release-tools/node_modules/tslib/tslib.js:112:62)
    cmderr	[automation_generate.sh] [ERROR]     at process.processTicksAndRejections (node:internal/process/task_queues:95:5)"
  • @azure/openai [Preview SDK Changes]
    info	[Changelog]
    error	breakingChangeTracking is enabled, but version or changelogItem is not found in output.
Posted by Swagger Pipeline | How to fix these errors?

Copy link

openapi-pipeline-app bot commented Apr 26, 2024

Generated ApiView

Language Package Name ApiView Link
TypeSpec OpenAI.Assistants https://apiview.dev/Assemblies/Review/4b4fdc5389144eb0b1bc12f2d179963a?revisionId=cbb7cab73c7d474493c779e42b807d77

@jpalvarezl jpalvarezl merged commit 7a6e0f3 into user/travisw/assistants-streaming-models-draft May 6, 2024
25 of 29 checks passed
@jpalvarezl jpalvarezl deleted the jpalvarezl/include_usage_models branch May 6, 2024 09:19
lmazuel pushed a commit that referenced this pull request May 24, 2024
… models (#28555)

* initial commit for models in support of streaming Assistants calls

* merge + pr feedback

* [OpenAI] [Assistants] PR feedback (#28786)

* Adding streaming events and modified class visibilities

* Represented the alias as a union to align better with the swagger and have a class generated

* Adding chunk classes to be included on code emission

* Update specification/ai/OpenAI.Assistants/streaming/events.tsp

* Added usage models for run and runStep (#28864)

* Added usage models for run and runStep

* Added added annotation

* Added warning suppresion for nullable fields

* Compiled with new models and unions

* back ported everything to a past version. Extracted SubmitToolOutputsOptions model

* re-compile

* Removed toolresources for now and added warning supressions

* Brought up to date the classes related to streaming for AssistantStreamEvent

* Making filename mandatory uploadFile operation

* Project compilation

* Re-formated definitiones according to CI instructions

* Added missing documentation

* Reverted nullability of fileName

* re-compiled

* Removed openapi v2 and v3 files generated with the placeholder version

* reformating

* Maded the stream events public to expose types and docs to users

* Made stream events publics

* remove single-use options model, merge into route params directly

* proactively add 2024-05-01-preview label

* Removed 05_01 from service version enum ... for now

* Added string type to AssistantStreamEvent

* tsp validation check

---------

Co-authored-by: Jose Alvarez <jpalvarezl@users.noreply.github.com>
Co-authored-by: Jose Alvarez <josealvar@microsoft.com>
lmazuel pushed a commit that referenced this pull request May 31, 2024
* initial commit for models in support of streaming Assistants calls

* merge + pr feedback

* [OpenAI] [Assistants] PR feedback (#28786)

* Adding streaming events and modified class visibilities

* Represented the alias as a union to align better with the swagger and have a class generated

* Adding chunk classes to be included on code emission

* Update specification/ai/OpenAI.Assistants/streaming/events.tsp

* Added usage models for run and runStep (#28864)

* Added usage models for run and runStep

* Added added annotation

* Added warning suppresion for nullable fields

* Compiled with new models and unions

* back ported everything to a past version. Extracted SubmitToolOutputsOptions model

* re-compile

* Removed toolresources for now and added warning supressions

* Brought up to date the classes related to streaming for AssistantStreamEvent

* Making filename mandatory uploadFile operation

* Project compilation

* Re-formated definitiones according to CI instructions

* Added new service version

* Figuring out error highlights in vscode

* Added get method listVectorStore

* extracted union

* Added create vector store method

* Adding method to get single vector store

* Added update methods for vector store

* Added deletion method for vector stores

* Removed assistant specific file models and operations

* Added operation for listing vector store files

* Added create file for vector store method

* Added the rest of the file operations

* Re-structured files under vector_store

* Reformated correctly

* Added first operation for vector store file batch

* Added file listing per vector store file batch

* WIP: AssistantsApiResponseFormatOption generates as anyOf of instead of oneOf

* corrected values for enum

* Adjusted Assistant response object

* Added browse azure tool call type and renamed retrieval to file_search

* Adding models for createAssistantsOptions

* Updated assistant update models

* Added TruncationObject

* Added tool_choice to run related objects

* Added new fields to ThreadRun model

* Added attachements and tool resources to thread and message related models

* 2nd pass to thread and message related files

* Renamed 'retrieva'->'file_search' added 'browse'

* Removed deprecated file endpoints and add java customizations for code gen

* Spellchecks

* Added missing documentation

* -clear

* Renamed union

* TSP validation check

* Reverted nullability of fileName

* re-compiled

* Added new file purposes

* Removed openapi v2 and v3 files generated with the placeholder version

* reformating

* Added AOAI fields for Files

* Added missing tool_resource object to createThreadAndRunRequest

* Updated docs and removed Browse tools for this release

* Maded the stream events public to expose types and docs to users

* Made stream events publics

* PR feedback and solved one open comment left for UpdateThreadOptions

* remove single-use options model, merge into route params directly

* proactively add 2024-05-01-preview label

* Removed model removed in upstream branch

* Recompile

* Removed 05_01 from service version enum ... for now

* Restored example

* Added string type to AssistantStreamEvent

* tsp validation check

* Duplicate doc annotation

* Removed duplicate entries

* Added documentation for API response formats

* Applied formatter

* Removed package and annotation usage causing issues in Java emitter

* Made temperature and top_p nullable for assistant create request

* Commented out linter rule breaking code emission

* Corrected double dot in documentation

* Restored linter rules for formater and adjusted definition of JSON polymorphic type

* Cleaned up comment

* Split out the string variants into their own union

* tsp format

* PR feedback

---------

Co-authored-by: Travis Wilson <travisw@microsoft.com>
Co-authored-by: Travis Wilson <35748617+trrwilson@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
TypeSpec Authored with TypeSpec
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants