|
483 | 483 | short-summary: Control foundry agents. |
484 | 484 | """ |
485 | 485 |
|
| 486 | +helps[ |
| 487 | + "cognitiveservices agent create" |
| 488 | +] = """ |
| 489 | +type: command |
| 490 | +short-summary: Create a new hosted agent from a container image or source code. |
| 491 | +long-summary: | |
| 492 | + Create a new hosted agent deployment by either specifying a pre-built container image |
| 493 | + or by building one from source code. When using --source, the container image is |
| 494 | + automatically built and pushed to Azure Container Registry. Configure compute resources, |
| 495 | + scaling behavior, environment variables, and communication protocols. |
| 496 | +parameters: |
| 497 | + - name: --account-name -a |
| 498 | + short-summary: Name of the Cognitive Services account. |
| 499 | + - name: --project-name -p |
| 500 | + short-summary: Name of the AI Foundry project. |
| 501 | + - name: --name -n |
| 502 | + short-summary: Name of the agent to create. |
| 503 | + - name: --image |
| 504 | + short-summary: Docker image URI with tag to use for the agent. |
| 505 | + long-summary: | |
| 506 | + Full Docker image URI including tag (e.g., myregistry.azurecr.io/myagent:v1.0). |
| 507 | + The tag identifies which container image version to use. The AI Foundry service |
| 508 | + automatically creates and manages the agent version independently. |
| 509 | + Mutually exclusive with --source. |
| 510 | + - name: --source |
| 511 | + short-summary: Path to source directory containing Dockerfile. |
| 512 | + long-summary: | |
| 513 | + When provided, builds the Docker image from source code and pushes to ACR. |
| 514 | + The image is built either locally (if Docker is available) or remotely using ACR Task. |
| 515 | + Mutually exclusive with --image. |
| 516 | + - name: --dockerfile |
| 517 | + short-summary: Name of the Dockerfile in source directory (default is 'Dockerfile'). |
| 518 | + long-summary: Only used when --source is specified. |
| 519 | + - name: --build-remote |
| 520 | + short-summary: Force remote build using Azure Container Registry Task. |
| 521 | + long-summary: | |
| 522 | + By default, the CLI attempts to build locally if Docker is available, |
| 523 | + otherwise builds remotely. Use this flag to force remote build. |
| 524 | + Only used when --source is specified. |
| 525 | + - name: --registry |
| 526 | + short-summary: Azure Container Registry name or full URI. |
| 527 | + long-summary: | |
| 528 | + Short name (e.g., 'myregistry') will be expanded to myregistry.azurecr.io. |
| 529 | + Full URIs (myregistry.azurecr.io) are also accepted. |
| 530 | + Required when using --source. |
| 531 | + - name: --cpu |
| 532 | + short-summary: CPU allocation (default is 1 core). |
| 533 | + - name: --memory |
| 534 | + short-summary: Memory allocation with unit (default is 2Gi). |
| 535 | + long-summary: Use units like '2Gi' for 2 gibibytes or '512Mi' for 512 mebibytes. |
| 536 | + - name: --min-replicas |
| 537 | + short-summary: Minimum number of replicas for scaling (default is 0). |
| 538 | + - name: --max-replicas |
| 539 | + short-summary: Maximum number of replicas for scaling (default is 3). |
| 540 | + - name: --env --environment-variables |
| 541 | + short-summary: Environment variables in key=value format. |
| 542 | + long-summary: Space-separated list in format 'key1=value1 key2=value2'. |
| 543 | + - name: --protocol |
| 544 | + short-summary: Communication protocol (responses or streaming). |
| 545 | + - name: --protocol-version |
| 546 | + short-summary: Protocol version (default is v1). |
| 547 | + - name: --timeout |
| 548 | + short-summary: Maximum time in seconds to wait for deployment to be ready. |
| 549 | + long-summary: | |
| 550 | + Default is 600 seconds (10 minutes). Increase for large container images |
| 551 | + or slow network conditions. The deployment process includes pulling the |
| 552 | + container image, starting the container, and health checks. |
| 553 | +examples: |
| 554 | + - name: Create agent from existing container image |
| 555 | + text: | |
| 556 | + az cognitiveservices agent create \\ |
| 557 | + --account-name myAccount \\ |
| 558 | + --project-name myProject \\ |
| 559 | + --name my-agent \\ |
| 560 | + --image myregistry.azurecr.io/my-agent:v1.0 |
| 561 | + - name: Create agent by building from source (auto-detect build method) |
| 562 | + text: | |
| 563 | + az cognitiveservices agent create \\ |
| 564 | + --account-name myAccount \\ |
| 565 | + --project-name myProject \\ |
| 566 | + --name my-agent \\ |
| 567 | + --source ./my-agent-code \\ |
| 568 | + --registry myregistry |
| 569 | + - name: Create agent by building from source with custom Dockerfile name |
| 570 | + text: | |
| 571 | + az cognitiveservices agent create \\ |
| 572 | + --account-name myAccount \\ |
| 573 | + --project-name myProject \\ |
| 574 | + --name my-agent \\ |
| 575 | + --source ./my-agent-code \\ |
| 576 | + --dockerfile Dockerfile.prod \\ |
| 577 | + --registry myregistry |
| 578 | + - name: Create agent by building remotely with ACR Task |
| 579 | + text: | |
| 580 | + az cognitiveservices agent create \\ |
| 581 | + --account-name myAccount \\ |
| 582 | + --project-name myProject \\ |
| 583 | + --name my-agent \\ |
| 584 | + --source ./my-agent-code \\ |
| 585 | + --registry myregistry \\ |
| 586 | + --build-remote |
| 587 | + - name: Create agent with custom CPU and memory |
| 588 | + text: | |
| 589 | + az cognitiveservices agent create \\ |
| 590 | + --account-name myAccount \\ |
| 591 | + --project-name myProject \\ |
| 592 | + --name my-agent \\ |
| 593 | + --image myregistry.azurecr.io/my-agent:v2.0 \\ |
| 594 | + --cpu 2 \\ |
| 595 | + --memory 4Gi |
| 596 | + - name: Create agent with scaling configuration |
| 597 | + text: | |
| 598 | + az cognitiveservices agent create \\ |
| 599 | + --account-name myAccount \\ |
| 600 | + --project-name myProject \\ |
| 601 | + --name my-agent \\ |
| 602 | + --image myregistry.azurecr.io/my-agent:v1.0 \\ |
| 603 | + --min-replicas 2 \\ |
| 604 | + --max-replicas 10 |
| 605 | + - name: Create agent with environment variables |
| 606 | + text: | |
| 607 | + az cognitiveservices agent create \\ |
| 608 | + --account-name myAccount \\ |
| 609 | + --project-name myProject \\ |
| 610 | + --name my-agent \\ |
| 611 | + --image myregistry.azurecr.io/my-agent:v1.0 \\ |
| 612 | + --env MODEL_NAME=gpt-4 API_TIMEOUT=30 LOG_LEVEL=info |
| 613 | + - name: Create agent with streaming protocol |
| 614 | + text: | |
| 615 | + az cognitiveservices agent create \\ |
| 616 | + --account-name myAccount \\ |
| 617 | + --project-name myProject \\ |
| 618 | + --name my-agent \\ |
| 619 | + --image myregistry.azurecr.io/my-agent:v1.0 \\ |
| 620 | + --protocol streaming \\ |
| 621 | + --protocol-version v1 |
| 622 | + - name: Create agent using short registry name |
| 623 | + text: | |
| 624 | + az cognitiveservices agent create \\ |
| 625 | + --account-name myAccount \\ |
| 626 | + --project-name myProject \\ |
| 627 | + --name my-agent \\ |
| 628 | + --image my-agent:v1.0 \\ |
| 629 | + --registry myregistry |
| 630 | + - name: Create agent with extended timeout for large images |
| 631 | + text: | |
| 632 | + az cognitiveservices agent create \\ |
| 633 | + --account-name myAccount \\ |
| 634 | + --project-name myProject \\ |
| 635 | + --name my-agent \\ |
| 636 | + --image myregistry.azurecr.io/my-large-agent:v1.0 \\ |
| 637 | + --timeout 1200 |
| 638 | +""" |
| 639 | + |
486 | 640 | helps[ |
487 | 641 | "cognitiveservices agent start" |
488 | 642 | ] = """ |
|
0 commit comments