Skip to content

Commit 11875c8

Browse files
glharperdargilcosingankitJarno Hakulinenhowieleung
authored
[AI] [Projects] Add OpenApi and fabric skill to Agents SDK (#38570)
* First version of client with endpoint operations * Make Endpoints sample work * Create EndpointProperties class. Implement client.endpoints.get_default * Support AzureAIClient.from_connection_string() * Make default input argument for .endpoints.get * Re-emit from latest TypeSpec. First attempt to support 3 different endpoints * Fix construction of the three endpoints * Re-emit from TypeSpec. Rename host_name to endpoint * Bug fix * Add methods ai_client.inference.get_chat_completions_client() and ai_client.inference.get_azure_openai_client() * Adding sample and changing client name (#37724) * Add .inference.get_embeddings_client() method * Jhakulin/azure ai client agents (#37748) * generated agents * merge latest * update * add patches * update * new version generated * fixes * fix merge error * update * use assistant_id for now * update * Create seperate inference samples * Move SASTokenCredential into .models * Add more agents samples (#37777) * add more samples * adjust sleep * review updates * Update _patch.py (#37760) * Online Evaluation changes (#37794) * Patch constructor for async AzureAIClient (#37804) * Users/singankit/evaluation add data mapping (#37824) * Update sample_evaluations.py * Update sample_evaluations.py * Fix .inference.get_azure_openai_client() for the async AzureAIClient (#37828) * migrate async, poll functions, and samples from assistant to agent (#37831) * migrate async, poll functions, and samples from assistant to agent * migrate async, poll functions, and samples from assistant to agent * resolved comments * resolve comments * using print instead of logging * moved ai_client to main function * Resolved comment * Fixed samples * [AI Client] adapt Sophia's assistant tests to client repo (#37819) * [AI Client] adapt Sophia's assistant tests to client repo * get tests running and passing with pytest * recordings pass and pushed * review feedback * Took out streaming from create_run, create_and_process_run, and submit_tool_outputs_to_run and declare separate functions for streaming (#37851) * Took out streaming from create_run, create_and_process_run, and submit_tool_outputs_to_run and declare separate functions for streaming * Took out create_and_process_stream and update samples accordingly * fixed samples * Miscellaneous updates (#37852) * Jhakulin/azure ai client pylance (#37887) * Fixes to Pylance error * fix sample * update * use file_upload_and_poll * updates to async samples * remove comment as we are using poll methods * more fixes * Use List instead of Sequence and fixed samples (#37898) * fixed warning for aio and get call function tools for stream within t… (#37913) * fixed warning for aio and get call function tools for stream within the SDK * Fixed another warning * Fixed return type * Evaluation API Review Feedback (#37915) * Evaluation API Review Feedback * add sample for evaluation schedule --------- Co-authored-by: Sai Kothinti <saikothinti@microsoft.com> * Fixed poll while loop and sample (#37922) * Jhakulin/azure ai client agents updates2 (#37937) * minor fixes and updates * update * update * create_vector_store_file_batch_and_poll + samples and update aio using the latest code from syn (#37952) * create_vector_store_file_batch_and_poll + samples and update aio using the latest code from sync * Resolved comments * Clean up on the Optional (#37971) * Switch from .endpoints to .connection (re-emit from latest TypeSpec) * updates and minor fixes (#37984) * Clean up (#37985) * Rename connection string environment variables Rename AI_CLIENT_CONNECTION_STRING to PROJECT_CONNECTION_STRING, to match how it's shown in Azure AI Studio. Also rename AZURE_AI_CLIENT_AGENTS_CONNECTION_STRING (used in Agents tests) to PROJECT_CONNECTION_STRING_AGENTS_TESTS * updated codeinterpreter attachment sample (#37990) * Filter parameters, returned by SSE event (#37991) * nirovins/filter_parameters * Fixes * Move utility functions out of class * Evaluation data set id change revert (#38007) * Updates to .connection operators (#38024) - Re-emit from latest TypeSpec - Updates to .connections operators to support the new preview version of REST API - Add "id" on ConnectionProperties * Users/singankit/ai project utils (#38033) * Sample upload file method on AI Client * Updating sample evaluation * Improving Evaluation user experience * Adding pip install link for evaluation * Update sample_evaluations.py * Reverting connection changes * Update _patch.py * First emit of azure-ai-project (_patch.py, samples and test not yet copied) * Copy _patch.py, samples, test, update names * Fix wrong import * M hietala/agent tools updates (#38031) * no need for function name separately in function definitions * more changes related to not needing to specify function names separately * adding capability to remove vector stores from file search tool * adding remove file to code interpreter * review comment related change --------- Co-authored-by: Marko Hietala <markhiet@microsoft.com> * add changes to latest typespec and ai-project changes (#38051) * Move agents test to agents folder (#38055) * Move agents test to agents folder * Copy changes to project * Prep for connection tests. (#38060) * Create azure-ai-projects folder * Add Inference tests (#38069) * re-doing the agent toolu updates after package changes (#38078) Co-authored-by: Marko Hietala <markhiet@microsoft.com> * Add .diagnostics.enable() method to fetch App Insights connection strings (#38109) * Users/singankit/evaluation async samples (#38104) * Adding async sample for evaluation * Update sample_evaluations_async.py * Fix sphinx docstring and cSpell (#38125) * Fix sphinx * Fix spelling * Fix * Fix II * Generate new code * Fix test * Fix * Disable evaluation schedule and remove sampling rate (#38161) * sdk changes for online eval disable schedule and remove sampling rate * change sample * Add tests for Connection operations (#38156) * update to get file content (#38165) * Jhakulin/parse messages (#38167) * parse messages * update * add test file * update * use stream for get file content * add get_file_content_stream * update * fix merge error * review feedback * more review comments * more review comments * Update README.md (#38173) * update to get file content (#38192) * Enable tracing (#38185) * added validation to tools and tools_resources, added update agent (#38195) * Rename `.diagnostics` to `.telemetry` (#38209) * Jhakulin/agents get file content async (#38201) * update to get file content * agents async updates * update * fix await/pylance issue * fix pylance error on AsyncToolSet * return empty set if no tool resources for code interpreter * added async toolset sample * Fixed test (#38222) * Support the new unified models deployed to the AIServices connection * Fixed validation to put AyncFunctionTool into ToolSet and FunctionTool into AsyncToolSet. Introduce BaseToolset. (#38244) * adding ai agents instrumentor (#38200) * adding ai agents instrumentor * streaming tracing sample and fixes to streaming tracing * moved tracing to agents tracing folder * adding support for tracing list_messages and async tracing sample * removing some commented out code * adding separate console and azure monitor tracing samples * removing unused code * removing more unused code * renamed tracing to telemetry. removed throwing from instrument and uninstrument * Update sdk/ai/azure-ai-projects/azure/ai/projects/telemetry/agents/_utils.py Co-authored-by: Liudmila Molkova <limolkova@microsoft.com> * Update sdk/ai/azure-ai-projects/azure/ai/projects/telemetry/agents/_ai_agents_instrumentor.py Co-authored-by: Liudmila Molkova <limolkova@microsoft.com> * Update sdk/ai/azure-ai-projects/azure/ai/projects/telemetry/agents/_ai_agents_instrumentor.py Co-authored-by: Liudmila Molkova <limolkova@microsoft.com> * fix for streaming with eventhandler and toolset * adding previous fix for async version also * adding missing function --------- Co-authored-by: Marko Hietala <markhiet@microsoft.com> Co-authored-by: Liudmila Molkova <limolkova@microsoft.com> * Jhakulin/user functions updates (#38248) * update to get file content * agents async updates * update * fix await/pylance issue * fix pylance error on AsyncToolSet * return empty set if no tool resources for code interpreter * added async toolset sample * updates to user functions * update * fix the array type for parameters * Connections & Inference test updates to support new unified models * Improve tracing samples and add docs on telemetry.enable (#38257) * Improve tracig samples and add docs on telemetry.enable * fix typo * Jhakulin/user functions optional (#38261) * update to get file content * agents async updates * update * fix await/pylance issue * fix pylance error on AsyncToolSet * return empty set if no tool resources for code interpreter * added async toolset sample * updates to user functions * update * fix the array type for parameters * support for Optional * update * one more example with list of dicts * adding content recording control to agents instrumentor api (#38268) Co-authored-by: Marko Hietala <markhiet@microsoft.com> * Howie/save file test (#38306) * Added test for save_file * resolved comment * Mypy fixes for instrumentor (#38302) * Fixes * Regenerate code * Merge again * Linter fixes * Regenerate the code * Fix mypy * More mypy fixes * Fix * Fix handling of SAS token and fix mypy (#38312) * Fix handling of SAS token and fix mypy * typo * Fix also pylance issue * Glharper/ai client new tools (#38202) * [AI Client] Add new search tools * add hooks to update connection lists for bing search * use updated typespec * use ConnectionType and ConnectionsOperations * endpointOperations -> ConnectionsOperations * add AzureAISearch tool def * adapt project with new tool changes * Add new tool defs for bing and azure ai search to projects.models * use service schema for BingGroundingTool * add samples for new tools * add sharepoint tool * update prompt to use bing browsing * add sharepoint_grounding discriminator * code gen from merged typespec * update to latest typespec * review feedback * add preview header to bing grounding and azure AI serach samples * Use 'Union' insted of '|' to make it run on Pyton 3.8 and up (#38344) * Fix mypy issues and re generate the code. (#38340) * Add more mypy fixes * Fix imports * Fix * Add safe conversion method * Fix mypy * Merge to main * Fix mypy * Fix unit test * Sphinx fix * Fix cspell * Use DefaultAzureCredential from azure.identity.aio for async samples (#38362) * Rename AAD to ENTRA_ID (#38363) * added agents example section in readme and added tags to samples (#38351) * added agents example section in readme and added tags to samples * Resolved comments * Added more detail to readme * Fix mypy and do not scan examples (#38375) * Changes in a package * Fix * Fix mypy * fix mypy * Fix * Connections APIs throw instead of returning None if a connection name/type is not found (#38383) * Make some APIs throw instead of returning None. Re-try to get connection string * Update README.md. Work in progress * Fixes * Add code interpreter file attachment sample and link to readme. Add alot more detail to readme also. (#38384) * Fix broken async .telemetry.enable() method, when you don't pass in "destination" (#38399) * Fix README. Fix Optional[str] * Fix async telemetry * Sample for thread with resource and document it in readme (#38393) * Users/singankit/evaluation test (#38402) * Test file * Adding fixture * Adding evaluation e2e test * Update azure_ai_projects_tests.env * Update how the inference URL is constructed (#38409) * First * Revert back this change * Fix some cspell errors, and link errors (#38420) * cspell lint --config .vscode/cspell.json --no-summary "sdk/ai/azure-ai-projects/**/*" * Resolved comments from Krista (#38405) * Address comments * Run black * Add support of Azure asset IDs for the vector store. (#38066) * Generate code * Generate new code * Expose file API and add the async test. * Remove unnecessary change * Add async samples * Do not create ML Client in tests * Better file retrieval * Regenerate code * Re generate the code * Re generate code * Fix samle name and make iterface more clear * Add samples for attachment enterprise search * Add unit tests for message attachment * Finzlize sync tests. * Add unit tests and use constants as a URI types * Regenerate code * Fix * Generate new code * Draft commit * Add another unit test * Fix and add test data * Regenerate files * Add more unit tests * Re generate code * Regenerate files * Rename classes and regenerate the code * Fixes * Fix parameter name * Fix file names * Script to check sample names inside file comments. * Fix PR comment by Krista on async credential in ConnectionProperties class (#38424) * Black * User/singankit/evaluation spellcheck (#38427) * Spell check errors evaluation * Removing test environment from evaluation schedule test * Fix doc string errors * Fix typing in samples (#38354) * Fix samples * Re enable type checks and remove extra code * Remove non needed code * Remove non needed changes * Remove non needed changes * Fixes * Return non optional client * Remove extra line * Fix file names * Fixes * Fix async file * Fix mypy issues and suppress the ones related to typespec * Fix cSpell * Re generate code and fix unit tests * Delete sdk/ai/azure-ai-projects/samples/config.json * Fix typo * Fix unit test * Run "black" (again) * Fix a few pyright errors, and address a comment in the Python PR (#38435) * Address some of Krista's PR comments (#38444) * sdk changes for name change for provisioning state and isEnabled online evaluation (#38298) * sdk changes for name change for provisioning state and isEnabled online evaluation * add correct tsp-location.yaml * azure-ai-projects: configure otel logging in telemetry.enable() helper (#38434) * Configure otel events in projects.telemetry.enable() * [ai] fix(pylint): Resolve `W1309`, `W0107`, `W0707`, `R1705`, `W0401`, `R1714`, `W0611`, `W0404`, `W0201`, `W1201` and `W1203` (#38447) * style: Run isort * fix(pylint): Resolve W1309(f-string-without-interpolation) From sdk/ai/azure-ai-projects, run: ruff check --select=F541 azure --fix * fix(pylint): Resolve W0107(unnecessary-pass) From sdk/ai/azure-ai-projects, run ruff check --select=PIE790 --fix azure * fix(pylint): Resolve W0707(raise-missing-from) * fix(pylint): Resolve R1705(no-else-return) From azure/ai/azure-ai-projects, run ruff check --select=RET505 --fix azure * fix(pylint): Resolve W0401(wildcard-import) * fix(pylint): Resolve R1714(consider-using-in) * fix(pylint): Resolve W0611(unused-import) * fix(pylint): Resolve W0404(reimported) * fix(pylint): Resolve W0201(attribute-defined-outside-init) * fix(pylint): Resolve W1201(logging-not-lazy) and W1203(logging-fstring-interpolation) * Add readme for get_message, save_file, get_file_content, tracing, Bing grounding, enterprise (#38426) * git Add readme for get_message, save_file, get_file_content, tracing * Readme for enterprise search, code interpreter, attachment * More documentation for tools * Fixed create_thread documentation * resolved comments * Resolved comments * Resolved comments from Krista * More fixes to mypy (#38446) * Fix unit tests and some type issues. * Fixes * Fix mypy * agents telemetry pyright fixes (#38457) Co-authored-by: Marko Hietala <markhiet@microsoft.com> * Fix pyright for agents. (#38464) * Fix as if python version is 3.8 * Fixed * Add custom config * Move line, ignoring import * fix pip install instruction (#38480) * [ai] fix(pylint): Resolve `C0301`, `C4739`, `C4740`, `C4741`, `C4742`, `C4743` for `azure-ai-projects` (#38459) * fix(pylint): Resolve C0301(line-too-long) * fix(pylint): Resolve C4743(docstring-should-be-keyword) * fix(pylint): Resolve C4739(docstring-missing-param) * fix(pylint): Resolve C4740(docstring-missing-type) * fix(pylint): Resolve C4741(docstring-missing-return) * fix(pylint): Resolve C4742(docstring-missing-rtype) * style: Run black * Enable test recordings for tests\inference, tests\telemetry and tests\connection (#38475) * Update cspell.json * Removed enterprise and add installation for tracing (#38483) * Removed enterprise and add installation for tracing * clean up * resolved comments * Fix mypy errors (#38487) * Run black --config ../../../eng/black-pyproject.toml * agents tracing pylint fixes (#38496) Co-authored-by: Marko Hietala <markhiet@microsoft.com> * Remove premature adding of asserts.json file * [ai] fix(pylint): Resolving remaining pylint errors (#38500) * fix(pylint): Resolve R1705(no-else-return) * fix(pylint): Resolve C0207(use-maxsplit-arg) * fix(pylint): Resolve C0412(ungrouped-imports) * fix(pylint): Resolve W1401(anomalous-backslash-in-string) * fix(pylint): Resolve W0105(pointless-string-statement) * fix(pylint): Ignore W0221(arguments-differ) pylint has an open issue tracking false positives for arguments-differ with overloads in subclasses * fix(pylint): Ignore W0718(broad-exception-caught) * fix(pylint): Ignore E0401(import-error) and E0611(no-name-in-module) * fix(pylint): Ignore C4748(client-accepts-api-verison-keyword) Currently, neither client classes supports overriding the api version * fix(pylint): Ignore W0212(protected-access) * fix(pylint): resolve W0707(raise-missing-from) * fix(pylint): Ignore E1102(not-callable) pylint appears to fail to correctly infer that settings.tracing_implementation actually is callable * fix(pylint): Ignore W0231(super-init-not-called) * fix(pylint): Ignore W0613(unused-argument) * fix(pylint): Ignore W0236(invalid-overriden-method) * fix(pylint): Ignore R0914(too-many-locals) * fix(pylint): Ignore R0902(too-many-instance-attributes) * fix(pylint): Ignore R0915(too-many-statements) * fix(pylint): Ignore R0911(too-many-return-statements) * Disable all agents tests. Push recordings for all other tests to the assents folder (#38481) * run "black --config ../../../eng/black-pyproject.toml ." * Fix pylint and new mypy issues (#38503) * Ignore most of pylint errors * Add generated paths to pylint.rc * Use backslash for consistency in pylintrc files --------- Co-authored-by: Darren Cohen <39422044+dargilco@users.noreply.github.com> * Remove async from .telemetry.enable (#38514) * Fix pylint * Rename `with_credentials` to `include_credentials` per apiview.dev review comment (#38517) * Try to fix test issues on Python 3.13. Run black * Try again to fix Python 3.13 test failure * Attempt to fix azure-ai-projects not showing up in the release pipeline * Fix release date in CHANGELOG.md * Fix CHANGELOG.md * README update. Address PR review comment * Update code snippets in pacakge README.md * More README.md fixes * More * Update tests README.md * add sharepoint sample, update Azure AI search constructor * update fabric skill with new TypeSpec * add fabric tool def and sample * fix agent function tool related info showing in traces when content recording disabled (#38573) Co-authored-by: Marko Hietala <markhiet@microsoft.com> * Fix a warning, happening when the async credentials are being used. (#38575) * First version of client with endpoint operations * Make Endpoints sample work * Create EndpointProperties class. Implement client.endpoints.get_default * Support AzureAIClient.from_connection_string() * Make default input argument for .endpoints.get * Re-emit from latest TypeSpec. First attempt to support 3 different endpoints * Fix construction of the three endpoints * Re-emit from TypeSpec. Rename host_name to endpoint * Bug fix * Add methods ai_client.inference.get_chat_completions_client() and ai_client.inference.get_azure_openai_client() * Adding sample and changing client name (#37724) * Add .inference.get_embeddings_client() method * Jhakulin/azure ai client agents (#37748) * generated agents * merge latest * update * add patches * update * new version generated * fixes * fix merge error * update * use assistant_id for now * update * Create seperate inference samples * Move SASTokenCredential into .models * Add more agents samples (#37777) * add more samples * adjust sleep * review updates * Update _patch.py (#37760) * Online Evaluation changes (#37794) * Patch constructor for async AzureAIClient (#37804) * Users/singankit/evaluation add data mapping (#37824) * Update sample_evaluations.py * Update sample_evaluations.py * Fix .inference.get_azure_openai_client() for the async AzureAIClient (#37828) * migrate async, poll functions, and samples from assistant to agent (#37831) * migrate async, poll functions, and samples from assistant to agent * migrate async, poll functions, and samples from assistant to agent * resolved comments * resolve comments * using print instead of logging * moved ai_client to main function * Resolved comment * Fixed samples * [AI Client] adapt Sophia's assistant tests to client repo (#37819) * [AI Client] adapt Sophia's assistant tests to client repo * get tests running and passing with pytest * recordings pass and pushed * review feedback * Took out streaming from create_run, create_and_process_run, and submit_tool_outputs_to_run and declare separate functions for streaming (#37851) * Took out streaming from create_run, create_and_process_run, and submit_tool_outputs_to_run and declare separate functions for streaming * Took out create_and_process_stream and update samples accordingly * fixed samples * Miscellaneous updates (#37852) * Jhakulin/azure ai client pylance (#37887) * Fixes to Pylance error * fix sample * update * use file_upload_and_poll * updates to async samples * remove comment as we are using poll methods * more fixes * Use List instead of Sequence and fixed samples (#37898) * fixed warning for aio and get call function tools for stream within t… (#37913) * fixed warning for aio and get call function tools for stream within the SDK * Fixed another warning * Fixed return type * Evaluation API Review Feedback (#37915) * Evaluation API Review Feedback * add sample for evaluation schedule --------- Co-authored-by: Sai Kothinti <saikothinti@microsoft.com> * Fixed poll while loop and sample (#37922) * Jhakulin/azure ai client agents updates2 (#37937) * minor fixes and updates * update * update * create_vector_store_file_batch_and_poll + samples and update aio using the latest code from syn (#37952) * create_vector_store_file_batch_and_poll + samples and update aio using the latest code from sync * Resolved comments * Clean up on the Optional (#37971) * Switch from .endpoints to .connection (re-emit from latest TypeSpec) * updates and minor fixes (#37984) * Clean up (#37985) * Rename connection string environment variables Rename AI_CLIENT_CONNECTION_STRING to PROJECT_CONNECTION_STRING, to match how it's shown in Azure AI Studio. Also rename AZURE_AI_CLIENT_AGENTS_CONNECTION_STRING (used in Agents tests) to PROJECT_CONNECTION_STRING_AGENTS_TESTS * updated codeinterpreter attachment sample (#37990) * Filter parameters, returned by SSE event (#37991) * nirovins/filter_parameters * Fixes * Move utility functions out of class * Evaluation data set id change revert (#38007) * Updates to .connection operators (#38024) - Re-emit from latest TypeSpec - Updates to .connections operators to support the new preview version of REST API - Add "id" on ConnectionProperties * Users/singankit/ai project utils (#38033) * Sample upload file method on AI Client * Updating sample evaluation * Improving Evaluation user experience * Adding pip install link for evaluation * Update sample_evaluations.py * Reverting connection changes * Update _patch.py * First emit of azure-ai-project (_patch.py, samples and test not yet copied) * Copy _patch.py, samples, test, update names * Fix wrong import * M hietala/agent tools updates (#38031) * no need for function name separately in function definitions * more changes related to not needing to specify function names separately * adding capability to remove vector stores from file search tool * adding remove file to code interpreter * review comment related change --------- Co-authored-by: Marko Hietala <markhiet@microsoft.com> * add changes to latest typespec and ai-project changes (#38051) * Move agents test to agents folder (#38055) * Move agents test to agents folder * Copy changes to project * Prep for connection tests. (#38060) * Create azure-ai-projects folder * Add Inference tests (#38069) * re-doing the agent toolu updates after package changes (#38078) Co-authored-by: Marko Hietala <markhiet@microsoft.com> * Add .diagnostics.enable() method to fetch App Insights connection strings (#38109) * Users/singankit/evaluation async samples (#38104) * Adding async sample for evaluation * Update sample_evaluations_async.py * Fix sphinx docstring and cSpell (#38125) * Fix sphinx * Fix spelling * Fix * Fix II * Generate new code * Fix test * Fix * Disable evaluation schedule and remove sampling rate (#38161) * sdk changes for online eval disable schedule and remove sampling rate * change sample * Add tests for Connection operations (#38156) * update to get file content (#38165) * Jhakulin/parse messages (#38167) * parse messages * update * add test file * update * use stream for get file content * add get_file_content_stream * update * fix merge error * review feedback * more review comments * more review comments * Update README.md (#38173) * update to get file content (#38192) * Enable tracing (#38185) * added validation to tools and tools_resources, added update agent (#38195) * Rename `.diagnostics` to `.telemetry` (#38209) * Jhakulin/agents get file content async (#38201) * update to get file content * agents async updates * update * fix await/pylance issue * fix pylance error on AsyncToolSet * return empty set if no tool resources for code interpreter * added async toolset sample * Fixed test (#38222) * Support the new unified models deployed to the AIServices connection * Fixed validation to put AyncFunctionTool into ToolSet and FunctionTool into AsyncToolSet. Introduce BaseToolset. (#38244) * adding ai agents instrumentor (#38200) * adding ai agents instrumentor * streaming tracing sample and fixes to streaming tracing * moved tracing to agents tracing folder * adding support for tracing list_messages and async tracing sample * removing some commented out code * adding separate console and azure monitor tracing samples * removing unused code * removing more unused code * renamed tracing to telemetry. removed throwing from instrument and uninstrument * Update sdk/ai/azure-ai-projects/azure/ai/projects/telemetry/agents/_utils.py Co-authored-by: Liudmila Molkova <limolkova@microsoft.com> * Update sdk/ai/azure-ai-projects/azure/ai/projects/telemetry/agents/_ai_agents_instrumentor.py Co-authored-by: Liudmila Molkova <limolkova@microsoft.com> * Update sdk/ai/azure-ai-projects/azure/ai/projects/telemetry/agents/_ai_agents_instrumentor.py Co-authored-by: Liudmila Molkova <limolkova@microsoft.com> * fix for streaming with eventhandler and toolset * adding previous fix for async version also * adding missing function --------- Co-authored-by: Marko Hietala <markhiet@microsoft.com> Co-authored-by: Liudmila Molkova <limolkova@microsoft.com> * Jhakulin/user functions updates (#38248) * update to get file content * agents async updates * update * fix await/pylance issue * fix pylance error on AsyncToolSet * return empty set if no tool resources for code interpreter * added async toolset sample * updates to user functions * update * fix the array type for parameters * Connections & Inference test updates to support new unified models * Improve tracing samples and add docs on telemetry.enable (#38257) * Improve tracig samples and add docs on telemetry.enable * fix typo * Jhakulin/user functions optional (#38261) * update to get file content * agents async updates * update * fix await/pylance issue * fix pylance error on AsyncToolSet * return empty set if no tool resources for code interpreter * added async toolset sample * updates to user functions * update * fix the array type for parameters * support for Optional * update * one more example with list of dicts * adding content recording control to agents instrumentor api (#38268) Co-authored-by: Marko Hietala <markhiet@microsoft.com> * Howie/save file test (#38306) * Added test for save_file * resolved comment * Mypy fixes for instrumentor (#38302) * Fixes * Regenerate code * Merge again * Linter fixes * Regenerate the code * Fix mypy * More mypy fixes * Fix * Fix handling of SAS token and fix mypy (#38312) * Fix handling of SAS token and fix mypy * typo * Fix also pylance issue * Glharper/ai client new tools (#38202) * [AI Client] Add new search tools * add hooks to update connection lists for bing search * use updated typespec * use ConnectionType and ConnectionsOperations * endpointOperations -> ConnectionsOperations * add AzureAISearch tool def * adapt project with new tool changes * Add new tool defs for bing and azure ai search to projects.models * use service schema for BingGroundingTool * add samples for new tools * add sharepoint tool * update prompt to use bing browsing * add sharepoint_grounding discriminator * code gen from merged typespec * update to latest typespec * review feedback * add preview header to bing grounding and azure AI serach samples * Use 'Union' insted of '|' to make it run on Pyton 3.8 and up (#38344) * Fix mypy issues and re generate the code. (#38340) * Add more mypy fixes * Fix imports * Fix * Add safe conversion method * Fix mypy * Merge to main * Fix mypy * Fix unit test * Sphinx fix * Fix cspell * Use DefaultAzureCredential from azure.identity.aio for async samples (#38362) * Rename AAD to ENTRA_ID (#38363) * added agents example section in readme and added tags to samples (#38351) * added agents example section in readme and added tags to samples * Resolved comments * Added more detail to readme * Fix mypy and do not scan examples (#38375) * Changes in a package * Fix * Fix mypy * fix mypy * Fix * Connections APIs throw instead of returning None if a connection name/type is not found (#38383) * Make some APIs throw instead of returning None. Re-try to get connection string * Update README.md. Work in progress * Fixes * Add code interpreter file attachment sample and link to readme. Add alot more detail to readme also. (#38384) * Fix broken async .telemetry.enable() method, when you don't pass in "destination" (#38399) * Fix README. Fix Optional[str] * Fix async telemetry * Sample for thread with resource and document it in readme (#38393) * Users/singankit/evaluation test (#38402) * Test file * Adding fixture * Adding evaluation e2e test * Update azure_ai_projects_tests.env * Update how the inference URL is constructed (#38409) * First * Revert back this change * Fix some cspell errors, and link errors (#38420) * cspell lint --config .vscode/cspell.json --no-summary "sdk/ai/azure-ai-projects/**/*" * Resolved comments from Krista (#38405) * Address comments * Run black * Add support of Azure asset IDs for the vector store. (#38066) * Generate code * Generate new code * Expose file API and add the async test. * Remove unnecessary change * Add async samples * Do not create ML Client in tests * Better file retrieval * Regenerate code * Re generate the code * Re generate code * Fix samle name and make iterface more clear * Add samples for attachment enterprise search * Add unit tests for message attachment * Finzlize sync tests. * Add unit tests and use constants as a URI types * Regenerate code * Fix * Generate new code * Draft commit * Add another unit test * Fix and add test data * Regenerate files * Add more unit tests * Re generate code * Regenerate files * Rename classes and regenerate the code * Fixes * Fix parameter name * Fix file names * Script to check sample names inside file comments. * Fix PR comment by Krista on async credential in ConnectionProperties class (#38424) * Black * User/singankit/evaluation spellcheck (#38427) * Spell check errors evaluation * Removing test environment from evaluation schedule test * Fix doc string errors * Fix typing in samples (#38354) * Fix samples * Re enable type checks and remove extra code * Remove non needed code * Remove non needed changes * Remove non needed changes * Fixes * Return non optional client * Remove extra line * Fix file names * Fixes * Fix async file * Fix mypy issues and suppress the ones related to typespec * Fix cSpell * Re generate code and fix unit tests * Delete sdk/ai/azure-ai-projects/samples/config.json * Fix typo * Fix unit test * Run "black" (again) * Fix a few pyright errors, and address a comment in the Python PR (#38435) * Address some of Krista's PR comments (#38444) * sdk changes for name change for provisioning state and isEnabled online evaluation (#38298) * sdk changes for name change for provisioning state and isEnabled online evaluation * add correct tsp-location.yaml * azure-ai-projects: configure otel logging in telemetry.enable() helper (#38434) * Configure otel events in projects.telemetry.enable() * [ai] fix(pylint): Resolve `W1309`, `W0107`, `W0707`, `R1705`, `W0401`, `R1714`, `W0611`, `W0404`, `W0201`, `W1201` and `W1203` (#38447) * style: Run isort * fix(pylint): Resolve W1309(f-string-without-interpolation) From sdk/ai/azure-ai-projects, run: ruff check --select=F541 azure --fix * fix(pylint): Resolve W0107(unnecessary-pass) From sdk/ai/azure-ai-projects, run ruff check --select=PIE790 --fix azure * fix(pylint): Resolve W0707(raise-missing-from) * fix(pylint): Resolve R1705(no-else-return) From azure/ai/azure-ai-projects, run ruff check --select=RET505 --fix azure * fix(pylint): Resolve W0401(wildcard-import) * fix(pylint): Resolve R1714(consider-using-in) * fix(pylint): Resolve W0611(unused-import) * fix(pylint): Resolve W0404(reimported) * fix(pylint): Resolve W0201(attribute-defined-outside-init) * fix(pylint): Resolve W1201(logging-not-lazy) and W1203(logging-fstring-interpolation) * Add readme for get_message, save_file, get_file_content, tracing, Bing grounding, enterprise (#38426) * git Add readme for get_message, save_file, get_file_content, tracing * Readme for enterprise search, code interpreter, attachment * More documentation for tools * Fixed create_thread documentation * resolved comments * Resolved comments * Resolved comments from Krista * More fixes to mypy (#38446) * Fix unit tests and some type issues. * Fixes * Fix mypy * agents telemetry pyright fixes (#38457) Co-authored-by: Marko Hietala <markhiet@microsoft.com> * Fix pyright for agents. (#38464) * Fix as if python version is 3.8 * Fixed * Add custom config * Move line, ignoring import * fix pip install instruction (#38480) * [ai] fix(pylint): Resolve `C0301`, `C4739`, `C4740`, `C4741`, `C4742`, `C4743` for `azure-ai-projects` (#38459) * fix(pylint): Resolve C0301(line-too-long) * fix(pylint): Resolve C4743(docstring-should-be-keyword) * fix(pylint): Resolve C4739(docstring-missing-param) * fix(pylint): Resolve C4740(docstring-missing-type) * fix(pylint): Resolve C4741(docstring-missing-return) * fix(pylint): Resolve C4742(docstring-missing-rtype) * style: Run black * Enable test recordings for tests\inference, tests\telemetry and tests\connection (#38475) * Update cspell.json * Removed enterprise and add installation for tracing (#38483) * Removed enterprise and add installation for tracing * clean up * resolved comments * Fix mypy errors (#38487) * Run black --config ../../../eng/black-pyproject.toml * agents tracing pylint fixes (#38496) Co-authored-by: Marko Hietala <markhiet@microsoft.com> * Remove premature adding of asserts.json file * [ai] fix(pylint): Resolving remaining pylint errors (#38500) * fix(pylint): Resolve R1705(no-else-return) * fix(pylint): Resolve C0207(use-maxsplit-arg) * fix(pylint): Resolve C0412(ungrouped-imports) * fix(pylint): Resolve W1401(anomalous-backslash-in-string) * fix(pylint): Resolve W0105(pointless-string-statement) * fix(pylint): Ignore W0221(arguments-differ) pylint has an open issue tracking false positives for arguments-differ with overloads in subclasses * fix(pylint): Ignore W0718(broad-exception-caught) * fix(pylint): Ignore E0401(import-error) and E0611(no-name-in-module) * fix(pylint): Ignore C4748(client-accepts-api-verison-keyword) Currently, neither client classes supports overriding the api version * fix(pylint): Ignore W0212(protected-access) * fix(pylint): resolve W0707(raise-missing-from) * fix(pylint): Ignore E1102(not-callable) pylint appears to fail to correctly infer that settings.tracing_implementation actually is callable * fix(pylint): Ignore W0231(super-init-not-called) * fix(pylint): Ignore W0613(unused-argument) * fix(pylint): Ignore W0236(invalid-overriden-method) * fix(pylint): Ignore R0914(too-many-locals) * fix(pylint): Ignore R0902(too-many-instance-attributes) * fix(pylint): Ignore R0915(too-many-statements) * fix(pylint): Ignore R0911(too-many-return-statements) * Disable all agents tests. Push recordings for all other tests to the assents folder (#38481) * run "black --config ../../../eng/black-pyproject.toml ." * Fix pylint and new mypy issues (#38503) * Ignore most of pylint errors * Add generated paths to pylint.rc * Use backslash for consistency in pylintrc files --------- Co-authored-by: Darren Cohen <39422044+dargilco@users.noreply.github.com> * Remove async from .telemetry.enable (#38514) * Fix pylint * Rename `with_credentials` to `include_credentials` per apiview.dev review comment (#38517) * Try to fix test issues on Python 3.13. Run black * Try again to fix Python 3.13 test failure * Attempt to fix azure-ai-projects not showing up in the release pipeline * Fix release date in CHANGELOG.md * Fix CHANGELOG.md * README update. Address PR review comment * Update code snippets in pacakge README.md * More README.md fixes * More * Update tests README.md * Merge to upstream and fix the used warning * Fix tests * Fix linter * Fix linter * Fix linter * Fix * Fix --------- Co-authored-by: Darren Cohen <39422044+dargilco@users.noreply.github.com> Co-authored-by: Ankit Singhal <30610298+singankit@users.noreply.github.com> Co-authored-by: Jarno Hakulinen <jhakulin@microsoft.com> Co-authored-by: howieleung <howieleung@microsoft.com> Co-authored-by: Glenn Harper <64209257+glharper@users.noreply.github.com> Co-authored-by: Sai Kothinti <saikothinti@microsoft.com> Co-authored-by: M-Hietala <78813398+M-Hietala@users.noreply.github.com> Co-authored-by: Marko Hietala <markhiet@microsoft.com> Co-authored-by: Liudmila Molkova <limolkova@microsoft.com> Co-authored-by: kdestin <101366538+kdestin@users.noreply.github.com> * fixing bugs with asynchrounous agent tracing (#38599) Co-authored-by: Marko Hietala <markhiet@microsoft.com> * Fix toolset. (#38580) * First version of client with endpoint operations * Make Endpoints sample work * Create EndpointProperties class. Implement client.endpoints.get_default * Support AzureAIClient.from_connection_string() * Make default input argument for .endpoints.get * Re-emit from latest TypeSpec. First attempt to support 3 different endpoints * Fix construction of the three endpoints * Re-emit from TypeSpec. Rename host_name to endpoint * Bug fix * Add methods ai_client.inference.get_chat_completions_client() and ai_client.inference.get_azure_openai_client() * Adding sample and changing client name (#37724) * Add .inference.get_embeddings_client() method * Jhakulin/azure ai client agents (#37748) * generated agents * merge latest * update * add patches * update * new version generated * fixes * fix merge error * update * use assistant_id for now * update * Create seperate inference samples * Move SASTokenCredential into .models * Add more agents samples (#37777) * add more samples * adjust sleep * review updates * Update _patch.py (#37760) * Online Evaluation changes (#37794) * Patch constructor for async AzureAIClient (#37804) * Users/singankit/evaluation add data mapping (#37824) * Update sample_evaluations.py * Update sample_evaluations.py * Fix .inference.get_azure_openai_client() for the async AzureAIClient (#37828) * migrate async, poll functions, and samples from assistant to agent (#37831) * migrate async, poll functions, and samples from assistant to agent * migrate async, poll functions, and samples from assistant to agent * resolved comments * resolve comments * using print instead of logging * moved ai_client to main function * Resolved comment * Fixed samples * [AI Client] adapt Sophia's assistant tests to client repo (#37819) * [AI Client] adapt Sophia's assistant tests to client repo * get tests running and passing with pytest * recordings pass and pushed * review feedback * Took out streaming from create_run, create_and_process_run, and submit_tool_outputs_to_run and declare separate functions for streaming (#37851) * Took out streaming from create_run, create_and_process_run, and submit_tool_outputs_to_run and declare separate functions for streaming * Took out create_and_process_stream and update samples accordingly * fixed samples * Miscellaneous updates (#37852) * Jhakulin/azure ai client pylance (#37887) * Fixes to Pylance error * fix sample * update * use file_upload_and_poll * updates to async samples * remove comment as we are using poll methods * more fixes * Use List instead of Sequence and fixed samples (#37898) * fixed warning for aio and get call function tools for stream within t… (#37913) * fixed warning for aio and get call function tools for stream within the SDK * Fixed another warning * Fixed return type * Evaluation API Review Feedback (#37915) * Evaluation API Review Feedback * add sample for evaluation schedule --------- Co-authored-by: Sai Kothinti <saikothinti@microsoft.com> * Fixed poll while loop and sample (#37922) * Jhakulin/azure ai client agents updates2 (#37937) * minor fixes and updates * update * update * create_vector_store_file_batch_and_poll + samples and update aio using the latest code from syn (#37952) * create_vector_store_file_batch_and_poll + samples and update aio using the latest code from sync * Resolved comments * Clean up on the Optional (#37971) * Switch from .endpoints to .connection (re-emit from latest TypeSpec) * updates and minor fixes (#37984) * Clean up (#37985) * Rename connection string environment variables Rename AI_CLIENT_CONNECTION_STRING to PROJECT_CONNECTION_STRING, to match how it's shown in Azure AI Studio. Also rename AZURE_AI_CLIENT_AGENTS_CONNECTION_STRING (used in Agents tests) to PROJECT_CONNECTION_STRING_AGENTS_TESTS * updated codeinterpreter attachment sample (#37990) * Filter parameters, returned by SSE event (#37991) * nirovins/filter_parameters * Fixes * Move utility functions out of class * Evaluation data set id change revert (#38007) * Updates to .connection operators (#38024) - Re-emit from latest TypeSpec - Updates to .connections operators to support the new preview version of REST API - Add "id" on ConnectionProperties * Users/singankit/ai project utils (#38033) * Sample upload file method on AI Client * Updating sample evaluation * Improving Evaluation user experience * Adding pip install link for evaluation * Update sample_evaluations.py * Reverting connection changes * Update _patch.py * First emit of azure-ai-project (_patch.py, samples and test not yet copied) * Copy _patch.py, samples, test, update names * Fix wrong import * M hietala/agent tools updates (#38031) * no need for function name separately in function definitions * more changes related to not needing to specify function names separately * adding capability to remove vector stores from file search tool * adding remove file to code interpreter * review comment related change --------- Co-authored-by: Marko Hietala <markhiet@microsoft.com> * add changes to latest typespec and ai-project changes (#38051) * Move agents test to agents folder (#38055) * Move agents test to agents folder * Copy changes to project * Prep for connection tests. (#38060) * Create azure-ai-projects folder * Add Inference tests (#38069) * re-doing the agent toolu updates after package changes (#38078) Co-authored-by: Marko Hietala <markhiet@microsoft.com> * Add .diagnostics.enable() method to fetch App Insights connection strings (#38109) * Users/singankit/evaluation async samples (#38104) * Adding async sample for evaluation * Update sample_evaluations_async.py * Fix sphinx docstring and cSpell (#38125) * Fix sphinx * Fix spelling * Fix * Fix II * Generate new code * Fix test * Fix * Disable evaluation schedule and remove sampling rate (#38161) * sdk changes for online eval disable schedule and remove sampling rate * change sample * Add tests for Connection operations (#38156) * update to get file content (#38165) * Jhakulin/parse messages (#38167) * parse messages * update * add test file * update * use stream for get file content * add get_file_content_stream * update * fix merge error * review feedback * more review comments * more review comments * Update README.md (#38173) * update to get file content (#38192) * Enable tracing (#38185) * added validation to tools and tools_resources, added update agent (#38195) * Rename `.diagnostics` to `.telemetry` (#38209) * Jhakulin/agents get file content async (#38201) * update to get file content * agents async updates * update * fix await/pylance issue * fix pylance error on AsyncToolSet * return empty set if no tool resources for code interpreter * added async toolset sample * Fixed test (#38222) * Support the new unified models deployed to the AIServices connection * Fixed validation to put AyncFunctionTool into ToolSet and FunctionTool into AsyncToolSet. Introduce BaseToolset. (#38244) * adding ai agents instrumentor (#38200) * adding ai agents instrumentor * streaming tracing sample and fixes to streaming tracing * moved tracing to agents tracing folder * adding support for tracing list_messages and async tracing sample * removing some commented out code * adding separate console and azure monitor tracing samples * removing unused code * removing more unused code * renamed tracing to telemetry. removed throwing from instrument and uninstrument * Update sdk/ai/azure-ai-projects/azure/ai/projects/telemetry/agents/_utils.py Co-authored-by: Liudmila Molkova <limolkova@microsoft.com> * Update sdk/ai/azure-ai-projects/azure/ai/projects/telemetry/agents/_ai_agents_instrumentor.py Co-authored-by: Liudmila Molkova <limolkova@microsoft.com> * Update sdk/ai/azure-ai-projects/azure/ai/projects/telemetry/agents/_ai_agents_instrumentor.py Co-authored-by: Liudmila Molkova <limolkova@microsoft.com> * fix for streaming with eventhandler and toolset * adding previous fix for async version also * adding missing function --------- Co-authored-by: Marko Hietala <markhiet@microsoft.com> Co-authored-by: Liudmila Molkova <limolkova@microsoft.com> * Jhakulin/user functions updates (#38248) * update to get file content * agents async updates * update * fix await/pylance issue * fix pylance error on AsyncToolSet * return empty set if no tool resources for code interpreter * added async toolset sample * updates to user functions * update * fix the array type for parameters * Connections & Inference test updates to support new unified models * Improve tracing samples and add docs on telemetry.enable (#38257) * Improve tracig samples and add docs on telemetry.enable * fix typo * Jhakulin/user functions optional (#38261) * update to get file content * agents async updates * update * fix await/pylance issue * fix pylance error on AsyncToolSet * return empty set if no tool resources for code interpreter * added async toolset sample * updates to user functions * update * fix the array type for parameters * support for Optional * update * one more example with list of dicts * adding content recording control to agents instrumentor api (#38268) Co-authored-by: Marko Hietala <markhiet@microsoft.com> * Howie/save file test (#38306) * Added test for save_file * resolved comment * Mypy fixes for instrumentor (#38302) * Fixes * Regenerate code * Merge again * Linter fixes * Regenerate the code * Fix mypy * More mypy fixes * Fix * Fix handling of SAS token and fix mypy (#38312) * Fix handling of SAS token and fix mypy * typo * Fix also pylance issue * Glharper/ai client new tools (#38202) * [AI Client] Add new search tools * add hooks to update connection lists for bing search * use updated typespec * use ConnectionType and ConnectionsOperations * endpointOperations -> ConnectionsOperations * add AzureAISearch tool def * adapt project with new tool changes * Add new tool defs for bing and azure ai search to projects.models * use service schema for BingGroundingTool * add samples for new tools * add sharepoint tool * update prompt to use bing browsing * add sharepoint_grounding discriminator * code gen from merged typespec * update to latest typespec * review feedback * add preview header to bing grounding and azure AI serach samples * Use 'Union' insted of '|' to make it run on Pyton 3.8 and up (#38344) * Fix mypy issues and re generate the code. (#38340) * Add more mypy fixes * Fix imports * Fix * Add safe conversion method * Fix mypy * Merge to main * Fix mypy * Fix unit test * Sphinx fix * Fix cspell * Use DefaultAzureCredential from azure.identity.aio for async samples (#38362) * Rename AAD to ENTRA_ID (#38363) * added agents example section in readme and added tags to samples (#38351) * added agents example section in readme and added tags to samples * Resolved comments * Added more detail to readme * Fix mypy and do not scan examples (#38375) * Changes in a package * Fix * Fix mypy * fix mypy * Fix * Connections APIs throw instead of returning None if a connection name/type is not found (#38383) * Make some APIs throw instead of returning None. Re-try to get connection string * Update README.md. Work in progress * Fixes * Add code interpreter file attachment sample and link to readme. Add alot more detail to readme also. (#38384) * Fix broken async .telemetry.enable() method, when you don't pass in "destination" (#38399) * Fix README. Fix Optional[str] * Fix async telemetry * Sample for thread with resource and document it in readme (#38393) * Users/singankit/evaluation test (#38402) * Test file * Adding fixture * Adding evaluation e2e test * Update azure_ai_projects_tests.env * Update how the inference URL is constructed (#38409) * First * Revert back this change * Fix some cspell errors, and link errors (#38420) * cspell lint --config .vscode/cspell.json --no-summary "sdk/ai/azure-ai-projects/**/*" * Resolved comments from Krista (#38405) * Address comments * Run black * Add support of Azure asset IDs for the vector store. (#38066) * Generate code * Generate new code * Expose file API and add the async test. * Remove unnecessary change * Add async samples * Do not create ML Client in tests * Better file retrieval * Regenerate code * Re generate the code * Re generate code * Fix samle name and make iterface more clear * Add samples for attachment enterprise search * Add unit tests for message attachment * Finzlize sync tests. * Add unit tests and use constants as a URI types * Regenerate code * Fix * Generate new code * Draft commit * Add another unit test * Fix and add test data * Regenerate files * Add more unit tests * Re generate code * Regenerate files * Rename classes and regenerate the code * Fixes * Fix parameter name * Fix file names * Script to check sample names inside file comments. * Fix PR comment by Krista on async credential in ConnectionProperties class (#38424) * Black * User/singankit/evaluation spellcheck (#38427) * Spell check errors evaluation * Removing test environment from evaluation schedule test * Fix doc string errors * Fix typing in samples (#38354) * Fix samples * Re enable type checks and remove extra code * Remove non needed code * Remove non needed changes * Remove non needed changes * Fixes * Return non optional client * Remove extra line * Fix file names * Fixes * Fix async file * Fix mypy issues and suppress the ones related to typespec * Fix cSpell * Re generate code and fix unit tests * Delete sdk/ai/azure-ai-projects/samples/config.json * Fix typo * Fix unit test * Run "black" (again) * Fix a few pyright errors, and address a comment in the Python PR (#38435) * Address some of Krista's PR comments (#38444) * sdk changes for name change for provisioning state and isEnabled online evaluation (#38298) * sdk changes for name change for provisioning state and isEnabled online evaluation * add correct tsp-location.yaml * azure-ai-projects: configure otel logging in telemetry.enable() helper (#38434) * Configure otel events in projects.telemetry.enable() * [ai] fix(pylint): Resolve `W1309`, `W0107`, `W0707`, `R1705`, `W0401`, `R1714`, `W0611`, `W0404`, `W0201`, `W1201` and `W1203` (#38447) * style: Run isort * fix(pylint): Resolve W1309(f-string-without-interpolation) From sdk/ai/azure-ai-projects, run: ruff check --select=F541 azure --fix * fix(pylint): Resolve W0107(unnecessary-pass) From sdk/ai/azure-ai-projects, run ruff check --select=PIE790 --fix azure * fix(pylint): Resolve W0707(raise-missing-from) * fix(pylint): Resolve R1705(no-else-return) From azure/ai/azure-ai-projects, run ruff check --select=RET505 --fix azure * fix(pylint): Resolve W0401(wildcard-import) * fix(pylint): Resolve R1714(consider-using-in) * fix(pylint): Resolve W0611(unused-import) * fix(pylint): Resolve W0404(reimported) * fix(pylint): Resolve W0201(attribute-defined-outside-init) * fix(pylint): Resolve W1201(logging-not-lazy) and W1203(logging-fstring-interpolation) * Add readme for get_message, save_file, get_file_content, tracing, Bing grounding, enterprise (#38426) * git Add readme for get_message, save_file, get_file_content, tracing * Readme for enterprise search, code interpreter, attachment * More documentation for tools * Fixed create_thread documentation * resolved comments * Resolved comments * Resolved comments from Krista * More fixes to mypy (#38446) * Fix unit tests and some type issues. * Fixes * Fix mypy * agents telemetry pyright fixes (#38457) Co-authored-by: Marko Hietala <markhiet@microsoft.com> * Fix pyright for agents. (#38464) * Fix as if python version is 3.8 * Fixed * Add custom config * Move line, ignoring import * fix pip install instruction (#38480) * [ai] fix(pylint): Resolve `C0301`, `C4739`, `C4740`, `C4741`, `C4742`, `C4743` for `azure-ai-projects` (#38459) * fix(pylint): Resolve C0301(line-too-long) * fix(pylint): Resolve C4743(docstring-should-be-keyword) * fix(pylint): Resolve C4739(docstring-missing-param) * fix(pylint): Resolve C4740(docstring-missing-type) * fix(pylint): Resolve C4741(docstring-missing-return) * fix(pylint): Resolve C4742(docstring-missing-rtype) * style: Run black * Enable test recordings for tests\inference, tests\telemetry and tests\connection (#38475) * Update cspell.json * Removed enterprise and add installation for tracing (#38483) * Removed enterprise and add installation for tracing * clean up * resolved comments * Fix mypy errors (#38487) * Run black --config ../../../eng/black-pyproject.toml * agents tracing pylint fixes (#38496) Co-authored-by: Marko Hietala <markhiet@microsoft.com> * Remove premature adding of asserts.json file * [ai] fix(pylint): Resolving remaining pylint errors (#38500) * fix(pylint): Resolve R1705(no-else-return) * fix(pylint): Resolve C0207(use-maxsplit-arg) * fix(pylint): Resolve C0412(ungrouped-imports) * fix(pylint): Resolve W1401(anomalous-backslash-in-string) * fix(pylint): Resolve W0105(pointless-string-statement) * fix(pylint): Ignore W0221(arguments-differ) pylint has an open issue tracking false positives for arguments-differ with overloads in subclasses * fix(pylint): Ignore W0718(broad-exception-caught) * fix(pylint): Ignore E0401(import-error) and E0611(no-name-in-module) * fix(pylint): Ignore C4748(client-accepts-api-verison-keyword) Currently, neither client classes supports overriding the api version * fix(pylint): Ignore W0212(protected-access) * fix(pylint): resolve W0707(raise-missing-from) * fix(pylint): Ignore E1102(not-callable) pylint appears to fail to correctly infer that settings.tracing_implementation actually is callable * fix(pylint): Ignore W0231(super-init-not-called) * fix(pylint): Ignore W0613(unused-argument) * fix(pylint): Ignore W0236(invalid-overriden-method) * fix(pylint): Ignore R0914(too-many-locals) * fix(pylint): Ignore R0902(too-many-instance-attributes) * fix(pylint): Ignore R0915(too-many-statements) * fix(pylint): Ignore R0911(too-many-return-statements) * Disable all agents tests. Push recordings for all other tests to the assents folder (#38481) * run "black --config ../../../eng/black-pyproject.toml ." * Fix pylint and new mypy issues (#38503) * Ignore most of pylint errors * Add generated paths to pylint.rc * Use backslash for consistency in pylintrc files --------- Co-authored-by: Darren Cohen <39422044+dargilco@users.noreply.github.com> * Remove async from .telemetry.enable (#38514) * Fix pylint * Rename `with_credentials` to `include_credentials` per apiview.dev review comment (#38517) * Try to fix test issues on Python 3.13. Run black * Try again to fix Python 3.13 test failure * Attempt to fix azure-ai-projects not showing up in the release pipeline * Fix release date in CHANGELOG.md * Fix CHANGELOG.md * README update. Address PR review comment * Update code snippets in pacakge README.md * More README.md fixes * More * Update tests README.md * Fix for sync client * Add fix for sync and create corresponding unit test. * Add more test cases * Create async unit test. * Linter fixes * Revert linter editing * Skip tests * Draft * Fix --------- Co-authored-by: Darren Cohen <39422044+dargilco@users.noreply.github.com> Co-authored-by: Ankit Singhal <30610298+singankit@users.noreply.github.com> Co-authored-by: Jarno Hakulinen <jhakulin@microsoft.com> Co-authored-by: howieleung <howieleung@microsoft.com> Co-authored-by: Glenn Harper <64209257+glharper@users.noreply.github.com> Co-authored-by: Sai Kothinti <saikothinti@microsoft.com> Co-authored-by: M-Hietala <78813398+M-Hietala@users.noreply.github.com> Co-authored-by: Marko Hietala <markhiet@microsoft.com> Co-authored-by: Liudmila Molkova <limolkova@microsoft.com> Co-authored-by: kdestin <101366538+kdestin@users.noreply.github.com> * adding agent telemetry tests (marked as skipped for now until we have… (#38601) * adding agent telemetry tests (marked as skipped for now until we have recordings) * removing spell check for test files * trying to fix code formatting errors --------- Co-authored-by: Marko Hietala <markhiet@microsoft.com> * fixed streaming with function tool (#38715) * fixed streaming with function tool * updated readme * correct azure ai search sample * Update fabric sample prompr * add openapi spec for forthcoming openapi sample * added genned code for OpenAPIToolDefinition related classes * add OpenApiTool class * add sample * Remove comment in sample_agents_openapi.py * Use commit from feature/azure-ai-projects in tsp-location.yaml * Remove headers parameter from agent creation * review feedback * review feedback * remove samples for not-ready tools * review feedback --------- Co-authored-by: Darren Cohen <39422044+dargilco@users.noreply.github.com> Co-authored-by: Ankit Singhal <30610298+singankit@users.noreply.github.com> Co-authored-by: Jarno Hakulinen <jhakulin@microsoft.com> Co-authored-by: howieleung <howieleung@microsoft.com> Co-authored-by: Sai Kothinti <saikothinti@microsoft.com> Co-authored-by: nick863 <30440255+nick863@users.noreply.github.com> Co-authored-by: M-Hietala <78813398+M-Hietala@users.noreply.github.com> Co-authored-by: Marko Hietala <markhiet@microsoft.com> Co-authored-by: Liudmila Molkova <limolkova@microsoft.com> Co-authored-by: kdestin <101366538+kdestin@users.noreply.github.com>
1 parent f68288c commit 11875c8

File tree

8 files changed

+514
-21
lines changed

8 files changed

+514
-21
lines changed

.vscode/cspell.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1331,6 +1331,8 @@
13311331
"OTEL",
13321332
"GENAI",
13331333
"fspath",
1334+
"myindexname",
1335+
"wttr",
13341336
"azureopenai"
13351337
]
13361338
},

sdk/ai/azure-ai-projects/azure/ai/projects/models/__init__.py

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,14 @@
7575
OpenAIPageableListOfThreadRun,
7676
OpenAIPageableListOfVectorStore,
7777
OpenAIPageableListOfVectorStoreFile,
78+
OpenApiAnonymousAuthDetails,
79+
OpenApiAuthDetails,
80+
OpenApiConnectionAuthDetails,
81+
OpenApiConnectionSecurityScheme,
82+
OpenApiFunctionDefinition,
83+
OpenApiManagedAuthDetails,
84+
OpenApiManagedSecurityScheme,
85+
OpenApiToolDefinition,
7886
RecurrenceSchedule,
7987
RecurrenceTrigger,
8088
RequiredAction,
@@ -177,6 +185,7 @@
177185
MessageRole,
178186
MessageStatus,
179187
MessageStreamEvent,
188+
OpenApiAuthType,
180189
RunStatus,
181190
RunStepErrorCode,
182191
RunStepStatus,
@@ -262,6 +271,14 @@
262271
"OpenAIPageableListOfThreadRun",
263272
"OpenAIPageableListOfVectorStore",
264273
"OpenAIPageableListOfVectorStoreFile",
274+
"OpenApiAnonymousAuthDetails",
275+
"OpenApiAuthDetails",
276+
"OpenApiConnectionAuthDetails",
277+
"OpenApiConnectionSecurityScheme",
278+
"OpenApiFunctionDefinition",
279+
"OpenApiManagedAuthDetails",
280+
"OpenApiManagedSecurityScheme",
281+
"OpenApiToolDefinition",
265282
"RecurrenceSchedule",
266283
"RecurrenceTrigger",
267284
"RequiredAction",
@@ -361,6 +378,7 @@
361378
"MessageRole",
362379
"MessageStatus",
363380
"MessageStreamEvent",
381+
"OpenApiAuthType",
364382
"RunStatus",
365383
"RunStepErrorCode",
366384
"RunStepStatus",

sdk/ai/azure-ai-projects/azure/ai/projects/models/_enums.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -303,6 +303,19 @@ class MessageStreamEvent(str, Enum, metaclass=CaseInsensitiveEnumMeta):
303303
"""Event sent before a message is completed. The data of this event is of type ThreadMessage"""
304304

305305

306+
class OpenApiAuthType(str, Enum, metaclass=CaseInsensitiveEnumMeta):
307+
"""
308+
Authentication type for OpenApi endpoint. Allowed types are:
309+
- Anonymous (no authentication required)
310+
- Connection (requires connection_id to endpoint, as setup in AI Foundry)
311+
- Managed_Identity (requires audience for identity based auth)
312+
"""
313+
314+
ANONYMOUS = "anonymous"
315+
CONNECTION = "connection"
316+
MANAGED_IDENTITY = "managed_identity"
317+
318+
306319
class RunStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta):
307320
"""Possible values for the status of an agent thread run."""
308321

sdk/ai/azure-ai-projects/azure/ai/projects/models/_models.py

Lines changed: 267 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
from .._model_base import rest_discriminator, rest_field
1616
from ._enums import (
1717
AuthenticationType,
18+
OpenApiAuthType,
1819
RunStepType,
1920
VectorStoreChunkingStrategyRequestType,
2021
VectorStoreChunkingStrategyResponseType,
@@ -501,7 +502,7 @@ class ToolDefinition(_model_base.Model):
501502
You probably want to use the sub-classes and not this class directly. Known sub-classes are:
502503
AzureAISearchToolDefinition, BingGroundingToolDefinition, CodeInterpreterToolDefinition,
503504
MicrosoftFabricToolDefinition, FileSearchToolDefinition, FunctionToolDefinition,
504-
SharepointToolDefinition
505+
OpenApiToolDefinition, SharepointToolDefinition
505506
506507
507508
:ivar type: The object type. Required. Default value is None.
@@ -2871,6 +2872,271 @@ def __init__(self, *args: Any, **kwargs: Any) -> None:
28712872
self.object: Literal["list"] = "list"
28722873

28732874

2875+
class OpenApiAuthDetails(_model_base.Model):
2876+
"""authentication details for OpenApiFunctionDefinition.
2877+
2878+
You probably want to use the sub-classes and not this class directly. Known sub-classes are:
2879+
OpenApiAnonymousAuthDetails, OpenApiConnectionAuthDetails, OpenApiManagedAuthDetails
2880+
2881+
2882+
:ivar type: The type of authentication, must be anonymous/connection/managed_identity.
2883+
Required. Known values are: "anonymous", "connection", and "managed_identity".
2884+
:vartype type: str or ~azure.ai.projects.models.OpenApiAuthType
2885+
"""
2886+
2887+
__mapping__: Dict[str, _model_base.Model] = {}
2888+
type: str = rest_discriminator(name="type")
2889+
"""The type of authentication, must be anonymous/connection/managed_identity. Required. Known
2890+
values are: \"anonymous\", \"connection\", and \"managed_identity\"."""
2891+
2892+
@overload
2893+
def __init__(
2894+
self,
2895+
*,
2896+
type: str,
2897+
) -> None: ...
2898+
2899+
@overload
2900+
def __init__(self, mapping: Mapping[str, Any]) -> None:
2901+
"""
2902+
:param mapping: raw JSON to initialize the model.
2903+
:type mapping: Mapping[str, Any]
2904+
"""
2905+
2906+
def __init__(self, *args: Any, **kwargs: Any) -> None:
2907+
super().__init__(*args, **kwargs)
2908+
2909+
2910+
class OpenApiAnonymousAuthDetails(OpenApiAuthDetails, discriminator="anonymous"):
2911+
"""Security details for OpenApi anonymous authentication.
2912+
2913+
2914+
:ivar type: The object type, which is always 'anonymous'. Required.
2915+
:vartype type: str or ~azure.ai.projects.models.ANONYMOUS
2916+
"""
2917+
2918+
type: Literal[OpenApiAuthType.ANONYMOUS] = rest_discriminator(name="type") # type: ignore
2919+
"""The object type, which is always 'anonymous'. Required."""
2920+
2921+
@overload
2922+
def __init__(
2923+
self,
2924+
) -> None: ...
2925+
2926+
@overload
2927+
def __init__(self, mapping: Mapping[str, Any]) -> None:
2928+
"""
2929+
:param mapping: raw JSON to initialize the model.
2930+
:type mapping: Mapping[str, Any]
2931+
"""
2932+
2933+
def __init__(self, *args: Any, **kwargs: Any) -> None:
2934+
super().__init__(*args, type=OpenApiAuthType.ANONYMOUS, **kwargs)
2935+
2936+
2937+
class OpenApiConnectionAuthDetails(OpenApiAuthDetails, discriminator="connection"):
2938+
"""Security details for OpenApi connection authentication.
2939+
2940+
2941+
:ivar type: The object type, which is always 'connection'. Required.
2942+
:vartype type: str or ~azure.ai.projects.models.CONNECTION
2943+
:ivar security_scheme: Connection auth security details. Required.
2944+
:vartype security_scheme: ~azure.ai.projects.models.OpenApiConnectionSecurityScheme
2945+
"""
2946+
2947+
type: Literal[OpenApiAuthType.CONNECTION] = rest_discriminator(name="type") # type: ignore
2948+
"""The object type, which is always 'connection'. Required."""
2949+
security_scheme: "_models.OpenApiConnectionSecurityScheme" = rest_field()
2950+
"""Connection auth security details. Required."""
2951+
2952+
@overload
2953+
def __init__(
2954+
self,
2955+
*,
2956+
security_scheme: "_models.OpenApiConnectionSecurityScheme",
2957+
) -> None: ...
2958+
2959+
@overload
2960+
def __init__(self, mapping: Mapping[str, Any]) -> None:
2961+
"""
2962+
:param mapping: raw JSON to initialize the model.
2963+
:type mapping: Mapping[str, Any]
2964+
"""
2965+
2966+
def __init__(self, *args: Any, **kwargs: Any) -> None:
2967+
super().__init__(*args, type=OpenApiAuthType.CONNECTION, **kwargs)
2968+
2969+
2970+
class OpenApiConnectionSecurityScheme(_model_base.Model):
2971+
"""Security scheme for OpenApi managed_identity authentication.
2972+
2973+
2974+
:ivar connection_id: Connection id for Connection auth type. Required.
2975+
:vartype connection_id: str
2976+
"""
2977+
2978+
connection_id: str = rest_field()
2979+
"""Connection id for Connection auth type. Required."""
2980+
2981+
@overload
2982+
def __init__(
2983+
self,
2984+
*,
2985+
connection_id: str,
2986+
) -> None: ...
2987+
2988+
@overload
2989+
def __init__(self, mapping: Mapping[str, Any]) -> None:
2990+
"""
2991+
:param mapping: raw JSON to initialize the model.
2992+
:type mapping: Mapping[str, Any]
2993+
"""
2994+
2995+
def __init__(self, *args: Any, **kwargs: Any) -> None:
2996+
super().__init__(*args, **kwargs)
2997+
2998+
2999+
class OpenApiFunctionDefinition(_model_base.Model):
3000+
"""The input definition information for an openapi function.
3001+
3002+
3003+
:ivar name: The name of the function to be called. Required.
3004+
:vartype name: str
3005+
:ivar description: A description of what the function does, used by the model to choose when
3006+
and how to call the function.
3007+
:vartype description: str
3008+
:ivar spec: The openapi function shape, described as a JSON Schema object. Required.
3009+
:vartype spec: any
3010+
:ivar auth: Open API authentication details. Required.
3011+
:vartype auth: ~azure.ai.projects.models.OpenApiAuthDetails
3012+
"""
3013+
3014+
name: str = rest_field()
3015+
"""The name of the function to be called. Required."""
3016+
description: Optional[str] = rest_field()
3017+
"""A description of what the function does, used by the model to choose when and how to call the
3018+
function."""
3019+
spec: Any = rest_field()
3020+
"""The openapi function shape, described as a JSON Schema object. Required."""
3021+
auth: "_models.OpenApiAuthDetails" = rest_field()
3022+
"""Open API authentication details. Required."""
3023+
3024+
@overload
3025+
def __init__(
3026+
self,
3027+
*,
3028+
name: str,
3029+
spec: Any,
3030+
auth: "_models.OpenApiAuthDetails",
3031+
description: Optional[str] = None,
3032+
) -> None: ...
3033+
3034+
@overload
3035+
def __init__(self, mapping: Mapping[str, Any]) -> None:
3036+
"""
3037+
:param mapping: raw JSON to initialize the model.
3038+
:type mapping: Mapping[str, Any]
3039+
"""
3040+
3041+
def __init__(self, *args: Any, **kwargs: Any) -> None:
3042+
super().__init__(*args, **kwargs)
3043+
3044+
3045+
class OpenApiManagedAuthDetails(OpenApiAuthDetails, discriminator="managed_identity"):
3046+
"""Security details for OpenApi managed_identity authentication.
3047+
3048+
3049+
:ivar type: The object type, which is always 'managed_identity'. Required.
3050+
:vartype type: str or ~azure.ai.projects.models.MANAGED_IDENTITY
3051+
:ivar security_scheme: Connection auth security details. Required.
3052+
:vartype security_scheme: ~azure.ai.projects.models.OpenApiManagedSecurityScheme
3053+
"""
3054+
3055+
type: Literal[OpenApiAuthType.MANAGED_IDENTITY] = rest_discriminator(name="type") # type: ignore
3056+
"""The object type, which is always 'managed_identity'. Required."""
3057+
security_scheme: "_models.OpenApiManagedSecurityScheme" = rest_field()
3058+
"""Connection auth security details. Required."""
3059+
3060+
@overload
3061+
def __init__(
3062+
self,
3063+
*,
3064+
security_scheme: "_models.OpenApiManagedSecurityScheme",
3065+
) -> None: ...
3066+
3067+
@overload
3068+
def __init__(self, mapping: Mapping[str, Any]) -> None:
3069+
"""
3070+
:param mapping: raw JSON to initialize the model.
3071+
:type mapping: Mapping[str, Any]
3072+
"""
3073+
3074+
def __init__(self, *args: Any, **kwargs: Any) -> None:
3075+
super().__init__(*args, type=OpenApiAuthType.MANAGED_IDENTITY, **kwargs)
3076+
3077+
3078+
class OpenApiManagedSecurityScheme(_model_base.Model):
3079+
"""Security scheme for OpenApi managed_identity authentication.
3080+
3081+
3082+
:ivar audience: Authentication scope for managed_identity auth type. Required.
3083+
:vartype audience: str
3084+
"""
3085+
3086+
audience: str = rest_field()
3087+
"""Authentication scope for managed_identity auth type. Required."""
3088+
3089+
@overload
3090+
def __init__(
3091+
self,
3092+
*,
3093+
audience: str,
3094+
) -> None: ...
3095+
3096+
@overload
3097+
def __init__(self, mapping: Mapping[str, Any]) -> None:
3098+
"""
3099+
:param mapping: raw JSON to initialize the model.
3100+
:type mapping: Mapping[str, Any]
3101+
"""
3102+
3103+
def __init__(self, *args: Any, **kwargs: Any) -> None:
3104+
super().__init__(*args, **kwargs)
3105+
3106+
3107+
class OpenApiToolDefinition(ToolDefinition, discriminator="openapi"):
3108+
"""The input definition information for an OpenAPI tool as used to configure an agent.
3109+
3110+
3111+
:ivar type: The object type, which is always 'openapi'. Required. Default value is "openapi".
3112+
:vartype type: str
3113+
:ivar openapi: The openapi function definition. Required.
3114+
:vartype openapi: ~azure.ai.projects.models.OpenApiFunctionDefinition
3115+
"""
3116+
3117+
type: Literal["openapi"] = rest_discriminator(name="type") # type: ignore
3118+
"""The object type, which is always 'openapi'. Required. Default value is \"openapi\"."""
3119+
openapi: "_models.OpenApiFunctionDefinition" = rest_field()
3120+
"""The openapi function definition. Required."""
3121+
3122+
@overload
3123+
def __init__(
3124+
self,
3125+
*,
3126+
openapi: "_models.OpenApiFunctionDefinition",
3127+
) -> None: ...
3128+
3129+
@overload
3130+
def __init__(self, mapping: Mapping[str, Any]) -> None:
3131+
"""
3132+
:param mapping: raw JSON to initialize the model.
3133+
:type mapping: Mapping[str, Any]
3134+
"""
3135+
3136+
def __init__(self, *args: Any, **kwargs: Any) -> None:
3137+
super().__init__(*args, type="openapi", **kwargs)
3138+
3139+
28743140
class RecurrenceSchedule(_model_base.Model):
28753141
"""RecurrenceSchedule Definition.
28763142

0 commit comments

Comments
 (0)