You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: articles/ai-services/openai/concepts/assistants.md
+12-5Lines changed: 12 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,5 +1,5 @@
1
1
---
2
-
title: Azure OpenAI Service Assistant API concepts
2
+
title: Azure OpenAI Service Assistants API concepts
3
3
titleSuffix: Azure OpenAI Service
4
4
description: Learn about the concepts behind the Azure OpenAI Assistants API.
5
5
ms.topic: conceptual
@@ -15,6 +15,11 @@ recommendations: false
15
15
16
16
Assistants, a new feature of Azure OpenAI Service, is now available in public preview. Assistants API makes it easier for developers to create applications with sophisticated copilot-like experiences that can sift through data, suggest solutions, and automate tasks.
17
17
18
+
* Assistants can call Azure OpenAI’s [models](../concepts/models.md) with specific instructions to tune their personality and capabilities.
19
+
* Assistants can access **multiple tools in parallel**. These can be both Azure OpenAI-hosted tools like [code interpreter](../how-to/code-interpreter.md) and [file search](../how-to/file-search.md), or tools you build, host, and access through [function calling](../how-to/function-calling.md).
20
+
* Assistants can access **persistent Threads**. Threads simplify AI application development by storing message history and truncating it when the conversation gets too long for the model's context length. You create a Thread once, and simply append Messages to it as your users reply.
21
+
* Assistants can access files in several formats. Either as part of their creation or as part of Threads between Assistants and users. When using tools, Assistants can also create files (such as images or spreadsheets) and cite files they reference in the Messages they create.
22
+
18
23
## Overview
19
24
20
25
Previously, building custom AI assistants needed heavy lifting even for experienced developers. While the chat completions API is lightweight and powerful, it's inherently stateless, which means that developers had to manage conversation state and chat threads, tool integrations, retrieval documents and indexes, and execute code manually.
@@ -26,19 +31,21 @@ Assistants API supports persistent automatically managed threads. This means tha
> There is no additional [pricing](https://azure.microsoft.com/pricing/details/cognitive-services/openai-service/) or [quota](../quotas-limits.md) for using Assistants unless you use the [code interpreter](../how-to/code-interpreter.md)tool.
34
+
> There is no additional [pricing](https://azure.microsoft.com/pricing/details/cognitive-services/openai-service/) or [quota](../quotas-limits.md) for using Assistants unless you use the [code interpreter](../how-to/code-interpreter.md)or [file search](../how-to/) tools.
30
35
31
-
Assistant API is built on the same capabilities that power OpenAI’s GPT product. Some possible use cases range from AI-powered product recommender, sales analyst app, coding assistant, employee Q&A chatbot, and more. Start building on the no-code Assistants playground on the Azure OpenAI Studio or start building with the API.
36
+
Assistants API is built on the same capabilities that power OpenAI’s GPT product. Some possible use cases range from AI-powered product recommender, sales analyst app, coding assistant, employee Q&A chatbot, and more. Start building on the no-code Assistants playground on the Azure OpenAI Studio, AI Studio, or start building with the API.
32
37
33
38
> [!IMPORTANT]
34
-
> Retrieving untrusted data using Function calling, Code Interpreter with file input, and Assistant Threads functionalities could compromise the security of your Assistant, or the application that uses the Assistant. Learn about mitigation approaches [here](https://aka.ms/oai/assistant-rai).
39
+
> Retrieving untrusted data using Function calling, Code Interpreter or File Search with file input, and Assistant Threads functionalities could compromise the security of your Assistant, or the application that uses the Assistant. Learn about mitigation approaches [here](https://aka.ms/oai/assistant-rai).
35
40
36
41
## Assistants playground
37
42
38
43
We provide a walkthrough of the Assistants playground in our [quickstart guide](../assistants-quickstart.md). This provides a no-code environment to test out the capabilities of assistants.
39
44
40
45
## Assistants components
41
46
47
+
:::image type="content" source="../media/assistants/assistants-overview.png" alt-text="A diagram showing the components of an assistant." lightbox="../media/assistants/assistants-overview.png:::
48
+
42
49
|**Component**|**Description**|
43
50
|---|---|
44
51
|**Assistant**| Custom AI that uses Azure OpenAI models in conjunction with tools. |
@@ -77,7 +84,7 @@ When using the File Search tool, we recommend setting the `max_prompt_tokens` to
77
84
You may also specify a truncation strategy to control how your thread should be rendered into the model's context window. Using a truncation strategy of type `auto` will use OpenAI's default truncation strategy. Using a truncation strategy of type `last_messages` will allow you to specify the number of the most recent messages to include in the context window.
78
85
79
86
## See also
80
-
87
+
* Learn more about Assistants and [File Search](../how-to/file-search.md)
81
88
* Learn more about Assistants and [Code Interpreter](../how-to/code-interpreter.md)
82
89
* Learn more about Assistants and [function calling](../how-to/assistant-functions.md)
83
90
*[Azure OpenAI Assistants API samples](https://github.com/Azure-Samples/azureai-samples/tree/main/scenarios/Assistants)
Copy file name to clipboardExpand all lines: articles/ai-services/openai/how-to/assistant-functions.md
+4Lines changed: 4 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -33,6 +33,10 @@ To use all features of function calling including parallel functions, you need t
33
33
34
34
## Example function definition
35
35
36
+
> [!NOTE]
37
+
> * We've added support for the `tool_choice` parameter which can be used to force the use of a specific tool (like `file_search`, `code_interpreter`, or a `function`) in a particular run.
38
+
> * Runs expire ten minutes after creation. Be sure to submit your tool outputs before the 10 min mark.
Copy file name to clipboardExpand all lines: articles/ai-services/openai/how-to/assistant.md
+7-4Lines changed: 7 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -24,7 +24,7 @@ Azure OpenAI Assistants (Preview) allows you to create AI assistants tailored to
24
24
25
25
### Region and model support
26
26
27
-
The [models page](../concepts/models.md#assistants-preview) contains the most up-to-date information on regions/models where Assistants are currently supported. Some [tools](#tools) may have limited regional or model support. For more information, see the article for the tools you want to use.
27
+
Code interpreter is available in all regions supported by Azure OpenAI Assistants. The [models page](../concepts/models.md#assistants-preview) contains the most up-to-date information on regions/models where Assistants are currently supported.
28
28
29
29
### API Version
30
30
@@ -64,6 +64,9 @@ The [models page](../concepts/models.md#assistants-preview) contains the most up
64
64
65
65
### Tools
66
66
67
+
> [!TIP]
68
+
> We've added support for the `tool_choice` parameter which can be used to force the use of a specific tool (like `file_search`, `code_interpreter`, or a `function`) in a particular run.
69
+
67
70
An individual assistant can access up to 128 tools including [code interpreter](./code-interpreter.md) and [file search](./file-search.md), but you can also define your own custom tools via [functions](./assistant-functions.md).
There are a few details you should note from the configuration above:
122
125
123
-
- We enable this assistant to access code interpreter with the line `tools=[{"type": "code_interpreter"}],`. This gives the model access to a sand-boxed python environment to run and execute code to help formulating responses to a user's question.
124
-
- In the instructions we remind the model that it can execute code. Sometimes the model needs help guiding it towards the right tool to solve a given query. If you know, you want to use a particular library to generate a certain response that you know is part of code interpreter it can help to provide guidance by saying something like "Use Matplotlib to do x."
125
-
- Since this is Azure OpenAI the value you enter for `model=`**must match the deployment name**. By convention our docs will often use a deployment name that happens to match the model name to indicate which model was used when testing a given example, but in your environment the deployment names can be different and that is the name that you should enter in the code.
126
+
- We enable this assistant to access code interpreter with the line `tools=[{"type": "code_interpreter"}],`. This gives the model access to a sand-boxed python environment to run and execute code to help formulating responses to a user's question.
127
+
- In the instructions we remind the model that it can execute code. Sometimes the model needs help guiding it towards the right tool to solve a given query. If you know you want to use a particular library to generate a certain response that you know is part of code interpreter, it can help to provide guidance by saying something like "Use Matplotlib to do x."
128
+
- Since this is Azure OpenAI the value you enter for `model=`**must match the deployment name**.
126
129
127
130
Next we're going to print the contents of assistant that we just created to confirm that creation was successful:
Copy file name to clipboardExpand all lines: articles/ai-services/openai/how-to/file-search.md
+5Lines changed: 5 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -16,6 +16,11 @@ recommendations: false
16
16
17
17
File Search augments the Assistant with knowledge from outside its model, such as proprietary product information or documents provided by your users. OpenAI automatically parses and chunks your documents, creates and stores the embeddings, and use both vector and keyword search to retrieve relevant content to answer user queries.
18
18
19
+
> [!IMPORTANT]
20
+
> File search has [additional charges](https://azure.microsoft.com/pricing/details/cognitive-services/openai-service/) beyond the token based fees for Azure OpenAI usage. If your Assistant calls file search simultaneously in two different threads, two file search sessions are created.
with client.beta.threads.runs.submit_tool_outputs_stream(
186
+
thread_id=self.current_run.thread_id,
187
+
run_id=self.current_run.id,
188
+
tool_outputs=tool_outputs,
189
+
event_handler=EventHandler(),
190
+
) as stream:
191
+
for text in stream.text_deltas:
192
+
print(text, end="", flush=True)
193
+
print()
194
+
195
+
196
+
with client.beta.threads.runs.stream(
197
+
thread_id=thread.id,
198
+
assistant_id=assistant.id,
199
+
event_handler=EventHandler()
200
+
) as stream:
201
+
stream.until_done()
202
+
```
203
+
204
+
---
205
+
144
206
## Using function in the chat completions API (Deprecated)
145
207
146
208
Function calling is available in the `2023-07-01-preview` API version and works with version 0613 of gpt-35-turbo, gpt-35-turbo-16k, gpt-4, and gpt-4-32k.
Copy file name to clipboardExpand all lines: articles/ai-services/openai/includes/assistants-v2-note.md
+3-1Lines changed: 3 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -8,4 +8,6 @@ ms.date: 04/22/2024
8
8
---
9
9
10
10
> [!NOTE]
11
-
> Azure OpenAI does not yet support Assistants V2. Please use the v1.20.0 release of the OpenAI Python library until V2 support is available.
11
+
> *[File search](../how-to/file-search.md) can ingest up to 10,000 files per assistant - 500 times more than before. It is fast, supports parallel queries through multi-threaded searches, and features enhanced reranking and query rewriting.
12
+
> * Vector store is a new object in the API. Once a file is added to a vector store, it's automatically parsed, chunked, and embedded, made ready to be searched. Vector stores can be used across assistants and threads, simplifying file management and billing.
13
+
> * We've added support for the `tool_choice` parameter which can be used to force the use of a specific tool (like file search, code interpreter, or a function) in a particular run.
Copy file name to clipboardExpand all lines: articles/ai-services/openai/whats-new.md
+4-1Lines changed: 4 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -27,8 +27,11 @@ A refresh of the Assistants API is now publicly available. It contains the follo
27
27
*[File search tool and vector storage](./how-to/file-search.md)
28
28
*[Max completion and max prompt token support](./concepts/assistants.md#context-window-management) for managing token usage.
29
29
*`tool_choice`[parameter](./assistants-reference-runs.md#run-object) for forcing the Assistant to use use a specified tool.
30
-
* New [assistant role](.//assistants-reference-messages.md#create-message)for creating custom conversation histories.
30
+
You can now create messages with the [assistant](.//assistants-reference-messages.md#create-message)role to create custom conversation histories in Threads.
31
31
* Support for `temperature`, `top_p`, `response_format`[parameters](./assistants-reference.md#create-an-assistant).
32
+
* Streaming and polling support. You can use the helper functions in our Python SDK to create runs and stream responses. We have also added polling SDK helpers to share object status updates without the need for polling.
33
+
* Experiment with Logic Apps and Function Calling using Azure OpenAI Studio. Import your REST APIs implemented in Logic Apps as functions and the studio invokes the function (as a Logic Apps workflow) automatically based on the user prompt.
34
+
* AutoGen by Microsoft Research provides a multi-agent conversation framework to enable convenient building of Large Language Model (LLM) workflows across a wide range of applications. Azure OpenAI assistants are now integrated into AutoGen via `GPTAssistantAgent`, a new experimental agent that lets you seamlessly add Assistants into AutoGen-based multi-agent workflows. This enables multiple Azure OpenAI assistants, that could be task or domain specialized, to collaborate and tackle complex tasks.
32
35
* Support for fine-tuned `gpt-3.5-turbo-0125`[models](./concepts/models.md#assistants-preview) in the following regions:
0 commit comments