Bagikan melalui


Menjelajahi Kernel Semantik AzureAIAgent

Penting

Fitur ini dalam tahap eksperimental. Fitur pada tahap ini sedang dalam pengembangan dan dapat berubah sebelum maju ke tahap pratinjau atau kandidat rilis.

Petunjuk / Saran

Dokumentasi API terperinci yang terkait dengan diskusi ini tersedia di:

Petunjuk / Saran

Dokumentasi API terperinci yang terkait dengan diskusi ini tersedia di:

Fitur saat ini tidak tersedia di Java.

Apa itu AzureAIAgent?

AzureAIAgent adalah agen khusus dalam kerangka kerja Kernel Semantik, yang dirancang untuk menyediakan kemampuan percakapan tingkat lanjut dengan integrasi alat yang mulus. Ini mengotomatiskan pemanggilan alat, sehingga tidak memerlukan penguraian dan pemanggilan secara manual. Agen juga mengelola riwayat percakapan dengan cara yang aman menggunakan utas, mengurangi beban tambahan dalam menjaga keberlangsungan percakapan. Selain itu, AzureAIAgent mendukung berbagai alat bawaan, termasuk pengambilan file, eksekusi kode, dan interaksi data melalui Bing, Azure AI Search, Azure Functions, dan OpenAPI.

Untuk menggunakan AzureAIAgent, perlu memanfaatkan Proyek Azure AI Foundry. Artikel berikut ini memberikan gambaran umum tentang Azure AI Foundry, cara membuat dan mengonfigurasi proyek, dan layanan agen:

Menyiapkan lingkungan pengembangan Anda

Untuk melanjutkan pengembangan AzureAIAgent, konfigurasikan lingkungan pengembangan Anda dengan paket yang sesuai.

Tambahkan paket Microsoft.SemanticKernel.Agents.AzureAI ke proyek Anda:

dotnet add package Microsoft.SemanticKernel.Agents.AzureAI --prerelease

Anda mungkin juga ingin menyertakan paket Azure.Identity:

dotnet add package Azure.Identity

Instal paket semantic-kernel:

pip install semantic-kernel

Fitur saat ini tidak tersedia di Java.

Mengonfigurasi Antarmuka Pengguna Proyek AI

Mengakses AzureAIAgent pertama memerlukan pembuatan klien yang dikonfigurasi untuk Proyek Foundry tertentu, biasanya dengan menyediakan titik akhir proyek Anda (Azure AI Foundry SDK: Memulai dengan Proyek).

PersistentAgentsClient client = AzureAIAgent.CreateAgentsClient("<your endpoint>", new AzureCliCredential());

Ubah file .env di direktori akar agar menyertakan:

AZURE_AI_AGENT_ENDPOINT = "<example-endpoint>"
AZURE_AI_AGENT_MODEL_DEPLOYMENT_NAME = "<example-model-deployment-name>"

Setelah konfigurasi ditentukan, klien dapat dibuat:

from semantic_kernel.agents import AzureAIAgent

async with (
    DefaultAzureCredential() as creds,
    AzureAIAgent.create_client(credential=creds) as client,
):
    # Your operational code here

Elemen dasar endpoint akan diambil oleh Pengaturan Pydantic jika dikonfigurasi. Jika tidak, Anda dapat secara eksplisit meneruskannya ke metode create_client().

from semantic_kernel.agents import AzureAIAgent

async with (
    DefaultAzureCredential() as creds,
    AzureAIAgent.create_client(credential=creds, endpoint="<your-endpoint>") as client,
):
    # Your operational code here

Fitur saat ini tidak tersedia di Java.

Membuat AzureAIAgent

Untuk membuat AzureAIAgent, Anda mulai dengan mengonfigurasi dan menginisialisasi proyek Foundry melalui layanan Agen Azure lalu mengintegrasikannya dengan Semantic Kernel:

PersistentAgentsClient client = AzureAIAgent.CreateAgentsClient("<your endpoint>", new AzureCliCredential());

// 1. Define an agent on the Azure AI agent service
PersistentAgent definition = await agentsClient.Administration.CreateAgentAsync(
    "<name of the the model used by the agent>",
    name: "<agent name>",
    description: "<agent description>",
    instructions: "<agent instructions>");

// 2. Create a Semantic Kernel agent based on the agent definition
AzureAIAgent agent = new(definition, agentsClient);
from azure.identity.aio import DefaultAzureCredential
from semantic_kernel.agents import AzureAIAgent, AzureAIAgentSettings

async with (
    DefaultAzureCredential() as creds,
    AzureAIAgent.create_client(credential=creds) as client,
):
    # 1. Define an agent on the Azure AI agent service
    agent_definition = await client.agents.create_agent(
        model=AzureAIAgentSettings().model_deployment_name,
        name="<name>",
        instructions="<instructions>",
    )

    # 2. Create a Semantic Kernel agent based on the agent definition
    agent = AzureAIAgent(
        client=client,
        definition=agent_definition,
    )

Fitur saat ini tidak tersedia di Java.

Berinteraksi dengan AzureAIAgent

Interaksi dengan AzureAIAgent itu mudah. Agen mempertahankan riwayat percakapan secara otomatis menggunakan utas.

Spesifikasi utas Agen Azure AI diabstraksi melalui Microsoft.SemanticKernel.Agents.AzureAI.AzureAIAgentThread kelas , yang merupakan implementasi dari Microsoft.SemanticKernel.Agents.AgentThread.

Penting

Perhatikan bahwa Azure AI Agents SDK memiliki PersistentAgentThread kelas . Ini tidak boleh disamakan dengan Microsoft.SemanticKernel.Agents.AgentThread, yang merupakan abstraksi Agen Kernel Semantik umum untuk semua jenis utas.

AzureAIAgent saat ini hanya mendukung utas jenis AzureAIAgentThread.

AzureAIAgentThread agentThread = new(agent.Client);
try
{
    ChatMessageContent message = new(AuthorRole.User, "<your user input>");
    await foreach (ChatMessageContent response in agent.InvokeAsync(message, agentThread))
    {
        Console.WriteLine(response.Content);
    }
}
finally
{
    await agentThread.DeleteAsync();
    await agent.Client.DeleteAgentAsync(agent.Id);
}

Spesifikasi utas Agen Azure AI diabstraksi melalui AzureAIAgentThread kelas , yang merupakan implementasi dari AgentThread.

USER_INPUTS = ["Hello", "What's your name?"]

thread: AzureAIAgentThread = AzureAIAgentThread()

try:
    for user_input in USER_INPUTS:
        response = await agent.get_response(messages=user_inputs, thread=thread)
        print(response)
        thread = response.thread
finally:
    await thread.delete() if thread else None

Secara opsional, agen dapat dipanggil sebagai:

for user_input in USER_INPUTS:
    async for content in agent.invoke(messages=user_input, thread=thread):
        print(content.content)
        thread = response.thread

Anda juga dapat meneruskan daftar pesan ke metode get_response(...), invoke(...), atau invoke_stream(...).

USER_INPUTS = ["Hello", "What's your name?"]

thread: AzureAIAgentThread = AzureAIAgentThread()

try:
    for user_input in USER_INPUTS:
        response = await agent.get_response(messages=USER_INPUTS, thread=thread)
        print(response)
        thread = response.thread
finally:
    await thread.delete() if thread else None

Agen juga dapat menghasilkan respons streaming.

ChatMessageContent message = new(AuthorRole.User, "<your user input>");
await foreach (StreamingChatMessageContent response in agent.InvokeStreamingAsync(message, agentThread))
{
    Console.Write(response.Content);
}
for user_input in USER_INPUTS:
    await agent.add_chat_message(thread_id=thread.id, message=user_input)
    async for content in agent.invoke_stream(thread_id=thread.id):
        print(content.content, end="", flush=True)

Fitur saat ini tidak tersedia di Java.

Menggunakan Plug-in dengan AzureAIAgent

Semantic Kernel mendukung perluasan AzureAIAgent dengan plugin kustom untuk fungsionalitas yang ditingkatkan:

KernelPlugin plugin = KernelPluginFactory.CreateFromType<YourPlugin>();
PersistentAgentsClient client = AzureAIAgent.CreateAgentsClient("<your endpoint>", new AzureCliCredential());

PersistentAgent definition = await agentsClient.Administration.CreateAgentAsync(
    "<name of the the model used by the agent>",
    name: "<agent name>",
    description: "<agent description>",
    instructions: "<agent instructions>");

AzureAIAgent agent = new(definition, agentsClient, plugins: [plugin]);
from semantic_kernel.functions import kernel_function

class SamplePlugin:
    @kernel_function(description="Provides sample data.")
    def get_data(self) -> str:
        return "Sample data"

async with (
        DefaultAzureCredential() as creds,
        AzureAIAgent.create_client(credential=creds) as client,
    ):
        agent_definition = await client.agents.create_agent(
            model=AzureAIAgentSettings().model_deployment_name,
        )

        agent = AzureAIAgent(
            client=client,
            definition=agent_definition,
            plugins=[SamplePlugin()]
        )

Fitur saat ini tidak tersedia di Java.

Fitur Tingkat Lanjut

AzureAIAgent dapat memanfaatkan alat canggih seperti:

Penerjemah Kode

Penerjemah Kode memungkinkan agen untuk menulis dan menjalankan kode Python di lingkungan eksekusi yang terisolasi dengan aman (Penerjemah Kode Layanan Agen Azure AI).

PersistentAgentsClient client = AzureAIAgent.CreateAgentsClient("<your endpoint>", new AzureCliCredential());

PersistentAgent definition = await agentsClient.CreateAgentAsync(
    "<name of the the model used by the agent>",
    name: "<agent name>",
    description: "<agent description>",
    instructions: "<agent instructions>",
    tools: [new CodeInterpreterToolDefinition()],
    toolResources:
        new()
        {
            CodeInterpreter = new()
            {
                FileIds = { ... },
            }
        }));

AzureAIAgent agent = new(definition, agentsClient);
from azure.ai.agents.models import CodeInterpreterTool

async with (
        DefaultAzureCredential() as creds,
        AzureAIAgent.create_client(credential=creds) as client,
    ):
        code_interpreter = CodeInterpreterTool()
        agent_definition = await client.agents.create_agent(
            model=ai_agent_settings.model_deployment_name,
            tools=code_interpreter.definitions,
            tool_resources=code_interpreter.resources,
        )

Fitur saat ini tidak tersedia di Java.

Pencarian file meningkatkan agen dengan pengetahuan dari luar modelnya (Azure AI Agent Service File Search Tool).

PersistentAgentsClient client = AzureAIAgent.CreateAgentsClient("<your endpoint>", new AzureCliCredential());

PersistentAgent definition = await agentsClient.CreateAgentAsync(
    "<name of the the model used by the agent>",
    name: "<agent name>",
    description: "<agent description>",
    instructions: "<agent instructions>",
    tools: [new FileSearchToolDefinition()],
    toolResources:
        new()
        {
            FileSearch = new()
            {
                VectorStoreIds = { ... },
            }
        });

AzureAIAgent agent = new(definition, agentsClient);
from azure.ai.agents.models import FileSearchTool

async with (
        DefaultAzureCredential() as creds,
        AzureAIAgent.create_client(credential=creds) as client,
    ):
        file_search = FileSearchTool(vector_store_ids=[vector_store.id])
        agent_definition = await client.agents.create_agent(
            model=ai_agent_settings.model_deployment_name,
            tools=file_search.definitions,
            tool_resources=file_search.resources,
        )

Fitur saat ini tidak tersedia di Java.

Integrasi OpenAPI

Menyambungkan agen Anda ke API eksternal (Cara menggunakan Azure AI Agent Service dengan OpenAPI Specified Tools).

PersistentAgentsClient client = AzureAIAgent.CreateAgentsClient("<your endpoint>", new AzureCliCredential());

string apiJsonSpecification = ...; // An Open API JSON specification

PersistentAgent definition = await agentsClient.CreateAgentAsync(
    "<name of the the model used by the agent>",
    name: "<agent name>",
    description: "<agent description>",
    instructions: "<agent instructions>",
    tools: [
        new OpenApiToolDefinition(
            "<api name>", 
            "<api description>", 
            BinaryData.FromString(apiJsonSpecification), 
            new OpenApiAnonymousAuthDetails())
    ]
);

AzureAIAgent agent = new(definition, agentsClient);
from azure.ai.agents.models import OpenApiTool, OpenApiAnonymousAuthDetails

async with (
    DefaultAzureCredential() as creds,
    AzureAIAgent.create_client(credential=creds) as client,
):
    openapi_spec_file_path = "sample/filepath/..."
    with open(os.path.join(openapi_spec_file_path, "spec_one.json")) as file_one:
        openapi_spec_one = json.loads(file_one.read())
    with open(os.path.join(openapi_spec_file_path, "spec_two.json")) as file_two:
        openapi_spec_two = json.loads(file_two.read())

    # Note that connection or managed identity auth setup requires additional setup in Azure
    auth = OpenApiAnonymousAuthDetails()
    openapi_tool_one = OpenApiTool(
        name="<name>",
        spec=openapi_spec_one,
        description="<description>",
        auth=auth,
    )
    openapi_tool_two = OpenApiTool(
        name="<name>",
        spec=openapi_spec_two,
        description="<description>",
        auth=auth,
    )

    agent_definition = await client.agents.create_agent(
        model=ai_agent_settings.model_deployment_name,
        tools=openapi_tool_one.definitions + openapi_tool_two.definitions,
    )

Fitur saat ini tidak tersedia di Java.

Integrasi Pencarian AzureAI

Gunakan indeks Pencarian Azure AI yang sudah ada dengan agen Anda (Gunakan indeks Pencarian AI yang sudah ada).

PersistentAgentsClient client = AzureAIAgent.CreateAgentsClient("<your endpoint>", new AzureCliCredential());

PersistentAgent definition = await agentsClient.CreateAgentAsync(
    "<name of the the model used by the agent>",
    name: "<agent name>",
    description: "<agent description>",
    instructions: "<agent instructions>",
    tools: [new AzureAISearchToolDefinition()],
    toolResources: new()
    {
        AzureAISearch = new()
        {
            IndexList = { new AISearchIndexResource("<your connection id>", "<your index name>") }
        }
    });

AzureAIAgent agent = new(definition, agentsClient);
from azure.ai.agents.models import AzureAISearchTool, ConnectionType

async with (
    DefaultAzureCredential() as creds,
    AzureAIAgent.create_client(credential=creds) as client,
):
    conn_list = await client.connections.list()

    ai_search_conn_id = ""
    for conn in conn_list:
        if conn.connection_type == ConnectionType.AZURE_AI_SEARCH:
            ai_search_conn_id = conn.id
            break

    ai_search = AzureAISearchTool(
        index_connection_id=ai_search_conn_id, 
        index_name=AZURE_AI_SEARCH_INDEX_NAME,
    )

    agent_definition = await client.agents.create_agent(
        model=ai_agent_settings.model_deployment_name,
        instructions="Answer questions using your index.",
        tools=ai_search.definitions,
        tool_resources=ai_search.resources,
        headers={"x-ms-enable-preview": "true"},
    )

Fitur saat ini tidak tersedia di Java.

Bing Grounding

Contoh segera hadir.

from azure.ai.agents.models import BingGroundingTool
from azure.identity.aio import DefaultAzureCredential

from semantic_kernel.agents import AzureAIAgent, AzureAIAgentSettings

async with (
    DefaultAzureCredential() as creds,
    AzureAIAgent.create_client(credential=creds) as client,
):
    # 1. Enter your Bing Grounding Connection Name
    bing_connection = await client.connections.get(connection_name="<your-bing-grounding-connection-name>")
    conn_id = bing_connection.id

    # 2. Initialize agent bing tool and add the connection id
    bing_grounding = BingGroundingTool(connection_id=conn_id)

    # 3. Create an agent with Bing grounding on the Azure AI agent service
    agent_definition = await client.agents.create_agent(
        name="BingGroundingAgent",
        instructions="Use the Bing grounding tool to answer the user's question.",
        model=AzureAIAgentSettings().model_deployment_name,
        tools=bing_grounding.definitions,
    )

    # 4. Create a Semantic Kernel agent for the Azure AI agent
    agent = AzureAIAgent(
        client=client,
        definition=agent_definition,
    )

Saat menggunakan alat Bing Grounding, callback yang FunctionCallContent diteruskan ke on_intermediate_message akan memiliki nama fungsi yang diatur ke "bing_grounding". Setelah proses selesai, ChatMessageContent.items daftar akan menyertakan AnnotationContent atau StreamingAnnotationContent, tergantung pada apakah pemanggilan standar atau streaming. Item anotasi ini berisi informasi tentang tautan yang dikunjungi agen selama respons, mirip dengan informasi yang ada di FunctionCallContent.

Untuk informasi selengkapnya, lihat sampel konsep berikut:

Fitur saat ini tidak tersedia di Java.

Mengambil AzureAIAgent yang Sudah Ada

Agen yang ada dapat diambil dan digunakan kembali dengan menentukan ID asistennya:

PersistentAgent definition = await agentsClient.Administration.GetAgentAsync("<your agent id>");
AzureAIAgent agent = new(definition, agentsClient);
agent_definition = await client.agents.get_agent(assistant_id="your-agent-id")
agent = AzureAIAgent(client=client, definition=agent_definition)

Fitur saat ini tidak tersedia di Java.

Menghapus sebuah AzureAIAgent

Agen dan utas terkaitnya dapat dihapus ketika tidak lagi diperlukan:

await agentThread.DeleteAsync();
await agentsClient.Administration.DeleteAgentAsync(agent.Id);
await client.agents.delete_thread(thread.id)
await client.agents.delete_agent(agent.id)

Jika bekerja dengan penyimpanan vektor atau file, mereka juga dapat dihapus:

await agentsClient.VectorStores.DeleteVectorStoreAsync("<your store id>");
await agentsClient.Files.DeleteFileAsync("<your file id>");
await client.agents.files.delete(file_id=file.id)
await client.agents.vector_stores.delete(vector_store_id=vector_store.id)

Fitur saat ini tidak tersedia di Java.

Informasi selengkapnya tentang alat pencarian file dijelaskan dalam artikel alat pencarian file Azure AI Agent Service.

Panduan Praktis

Untuk contoh praktis menggunakan AzureAIAgent, lihat sampel kode kami di GitHub:

Fitur saat ini tidak tersedia di Java.

Menangani Pesan Perantara dengan AzureAIAgent

Semantic Kernel AzureAIAgent dirancang untuk memanggil sebuah agen yang memenuhi kueri atau pertanyaan pengguna. Selama pemanggilan, agen dapat menjalankan alat untuk mendapatkan jawaban akhir. Untuk mengakses pesan perantara yang dihasilkan selama proses ini, penelepon dapat menyediakan fungsi panggilan balik yang menangani instans FunctionCallContent atau FunctionResultContent.

Dokumentasi callback untuk AzureAIAgent akan segera tersedia.

Mengonfigurasi on_intermediate_message panggilan balik dalam agent.invoke(...) atau agent.invoke_stream(...) memungkinkan pemanggil untuk menerima pesan perantara yang dihasilkan selama proses merumuskan respons akhir agen.

import asyncio
from typing import Annotated

from azure.identity.aio import DefaultAzureCredential

from semantic_kernel.agents import AzureAIAgent, AzureAIAgentSettings, AzureAIAgentThread
from semantic_kernel.contents import FunctionCallContent, FunctionResultContent
from semantic_kernel.contents.chat_message_content import ChatMessageContent
from semantic_kernel.functions import kernel_function


# Define a sample plugin for the sample
class MenuPlugin:
    """A sample Menu Plugin used for the concept sample."""

    @kernel_function(description="Provides a list of specials from the menu.")
    def get_specials(self) -> Annotated[str, "Returns the specials from the menu."]:
        return """
        Special Soup: Clam Chowder
        Special Salad: Cobb Salad
        Special Drink: Chai Tea
        """

    @kernel_function(description="Provides the price of the requested menu item.")
    def get_item_price(
        self, menu_item: Annotated[str, "The name of the menu item."]
    ) -> Annotated[str, "Returns the price of the menu item."]:
        return "$9.99"


# This callback function will be called for each intermediate message,
# which will allow one to handle FunctionCallContent and FunctionResultContent.
# If the callback is not provided, the agent will return the final response
# with no intermediate tool call steps.
async def handle_intermediate_steps(message: ChatMessageContent) -> None:
    for item in message.items or []:
        if isinstance(item, FunctionResultContent):
            print(f"Function Result:> {item.result} for function: {item.name}")
        elif isinstance(item, FunctionCallContent):
            print(f"Function Call:> {item.name} with arguments: {item.arguments}")
        else:
            print(f"{item}")


async def main() -> None:
    ai_agent_settings = AzureAIAgentSettings()

    async with (
        DefaultAzureCredential() as creds,
        AzureAIAgent.create_client(credential=creds, endpoint=ai_agent_settings.endpoint) as client,
    ):
        AGENT_NAME = "Host"
        AGENT_INSTRUCTIONS = "Answer questions about the menu."

        # Create agent definition
        agent_definition = await client.agents.create_agent(
            model=ai_agent_settings.deployment_name,
            name=AGENT_NAME,
            instructions=AGENT_INSTRUCTIONS,
        )

        # Create the AzureAI Agent
        agent = AzureAIAgent(
            client=client,
            definition=agent_definition,
            plugins=[MenuPlugin()],  # add the sample plugin to the agent
        )

        # Create a thread for the agent
        # If no thread is provided, a new thread will be
        # created and returned with the initial response
        thread: AzureAIAgentThread = None

        user_inputs = [
            "Hello",
            "What is the special soup?",
            "How much does that cost?",
            "Thank you",
        ]

        try:
            for user_input in user_inputs:
                print(f"# User: '{user_input}'")
                async for response in agent.invoke(
                    messages=user_input,
                    thread=thread,
                    on_intermediate_message=handle_intermediate_steps,
                ):
                    print(f"# Agent: {response}")
                    thread = response.thread
        finally:
            # Cleanup: Delete the thread and agent
            await thread.delete() if thread else None
            await client.agents.delete_agent(agent.id)


if __name__ == "__main__":
    asyncio.run(main())

Berikut ini menunjukkan sampel output dari proses pemanggilan agen:

User: 'Hello'
Agent: Hi there! How can I assist you today?
User: 'What is the special soup?'
Function Call:> MenuPlugin-get_specials with arguments: {}
Function Result:> 
        Special Soup: Clam Chowder
        Special Salad: Cobb Salad
        Special Drink: Chai Tea
        for function: MenuPlugin-get_specials
Agent: The special soup is Clam Chowder. Would you like to know anything else about the menu?
User: 'How much does that cost?'
Function Call:> MenuPlugin-get_item_price with arguments: {"menu_item":"Clam Chowder"}
Function Result:> $9.99 for function: MenuPlugin-get_item_price
Agent: The Clam Chowder costs $9.99. Let me know if you would like assistance with anything else!
User: 'Thank you'
Agent: You're welcome! Enjoy your meal! 😊

Fitur saat ini tidak tersedia di Java.

Spesifikasi Deklaratif

Dokumentasi tentang menggunakan spesifikasi deklaratif akan segera hadir.

Penting

Fitur ini dalam tahap eksperimental. Fitur pada tahap ini sedang dalam pengembangan dan dapat berubah sebelum maju ke tahap pratinjau atau kandidat rilis.

AzureAIAgent mendukung instansiasi dari spesifikasi deklaratif YAML. Pendekatan deklaratif memungkinkan Anda menentukan properti agen, instruksi, konfigurasi model, alat, dan opsi lainnya dalam satu dokumen yang dapat diaudit. Hal ini membuat komposisi agen portabel dan mudah dikelola di seluruh lingkungan.

Nota

Setiap alat, fungsi, atau plugin yang tercantum dalam YAML deklaratif harus tersedia untuk agen pada waktu konstruksi. Untuk plugin berbasis kernel, ini berarti plugin harus terdaftar di Kernel. Untuk alat bawaan seperti alat Bing Grounding, Pencarian File, atau OpenAPI, konfigurasi dan kredensial yang benar harus disediakan. Loader agen tidak akan membuat fungsi dari awal. Jika komponen yang diperlukan hilang, pembuatan agen akan gagal.

Cara Menggunakan Spesifikasi Deklaratif

Daripada menghitung setiap kemungkinan konfigurasi YAML, bagian ini menguraikan prinsip-prinsip utama dan menyediakan tautan ke sampel konsep yang menunjukkan kode lengkap untuk setiap jenis alat. Lihat sampel-sampel konsep ini untuk implementasi end-to-end dari AzureAIAgent dengan spesifikasi deklaratif.

Contoh: Membuat AzureAIAgent dari YAML

Spesifikasi deklaratif YAML minimal mungkin terlihat seperti berikut:

type: foundry_agent
name: MyAgent
instructions: Respond politely to the user's questions.
model:
  id: ${AzureAI:ChatModelId}
tools:
  - id: MenuPlugin.get_specials
    type: function
  - id: MenuPlugin.get_item_price
    type: function

Untuk detail tentang cara menyambungkan agen, lihat sampel kode lengkap di atas.

Poin Penting

  • Spesifikasi deklaratif memungkinkan menentukan struktur, alat, dan perilaku agen dalam YAML.
  • Semua alat dan plugin yang direferensikan harus terdaftar atau dapat diakses pada runtime.
  • Alat bawaan seperti Bing, Pencarian File, dan Penerjemah Kode memerlukan konfigurasi dan kredensial yang tepat (seringkali melalui variabel lingkungan atau argumen eksplisit).
  • Untuk contoh komprehensif, lihat tautan sampel yang disediakan yang menunjukkan skenario praktis, termasuk pendaftaran plugin, konfigurasi identitas Azure, dan penggunaan alat tingkat lanjut.

Fitur ini tidak tersedia.

Langkah Selanjutnya