[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill-023497af-af50-456e-8b0b-b46e924d8938":3,"$f7jYQdXPAru7vuYGy85nht-xYbDfNf8C4wv_E3JypsrM":43},{"id":4,"title":5,"description":6,"categoryId":7,"moduleId":8,"tags":9,"prompt":10,"icon":11,"source":12,"sourceUrl":13,"authorId":14,"authorName":15,"isPublic":16,"stars":17,"runs":18,"createdAt":19,"updatedAt":19,"module":20,"category":27,"packages":34},"023497af-af50-456e-8b0b-b46e924d8938","azure-ai-projects-ts","Azure AI Foundry项目的高级SDK，包括代理、连接、部署和评估。","cat_coding_devops","mod_coding","sickn33,coding","---\nname: azure-ai-projects-ts\ndescription: \"High-level SDK for Azure AI Foundry projects with agents, connections, deployments, and evaluations.\"\nrisk: unknown\nsource: community\ndate_added: \"2026-02-27\"\n---\n\n# Azure AI Projects SDK for TypeScript\n\nHigh-level SDK for Azure AI Foundry projects with agents, connections, deployments, and evaluations.\n\n## Installation\n\n```bash\nnpm install @azure\u002Fai-projects @azure\u002Fidentity\n```\n\nFor tracing:\n```bash\nnpm install @azure\u002Fmonitor-opentelemetry @opentelemetry\u002Fapi\n```\n\n## Environment Variables\n\n```bash\nAZURE_AI_PROJECT_ENDPOINT=https:\u002F\u002F\u003Cresource>.services.ai.azure.com\u002Fapi\u002Fprojects\u002F\u003Cproject>\nMODEL_DEPLOYMENT_NAME=gpt-4o\n```\n\n## Authentication\n\n```typescript\nimport { AIProjectClient } from \"@azure\u002Fai-projects\";\nimport { DefaultAzureCredential } from \"@azure\u002Fidentity\";\n\nconst client = new AIProjectClient(\n  process.env.AZURE_AI_PROJECT_ENDPOINT!,\n  new DefaultAzureCredential()\n);\n```\n\n## Operation Groups\n\n| Group | Purpose |\n|-------|---------|\n| `client.agents` | Create and manage AI agents |\n| `client.connections` | List connected Azure resources |\n| `client.deployments` | List model deployments |\n| `client.datasets` | Upload and manage datasets |\n| `client.indexes` | Create and manage search indexes |\n| `client.evaluators` | Manage evaluation metrics |\n| `client.memoryStores` | Manage agent memory |\n\n## Getting OpenAI Client\n\n```typescript\nconst openAIClient = await client.getOpenAIClient();\n\n\u002F\u002F Use for responses\nconst response = await openAIClient.responses.create({\n  model: \"gpt-4o\",\n  input: \"What is the capital of France?\"\n});\n\n\u002F\u002F Use for conversations\nconst conversation = await openAIClient.conversations.create({\n  items: [{ type: \"message\", role: \"user\", content: \"Hello!\" }]\n});\n```\n\n## Agents\n\n### Create Agent\n\n```typescript\nconst agent = await client.agents.createVersion(\"my-agent\", {\n  kind: \"prompt\",\n  model: \"gpt-4o\",\n  instructions: \"You are a helpful assistant.\"\n});\n```\n\n### Agent with Tools\n\n```typescript\n\u002F\u002F Code Interpreter\nconst agent = await client.agents.createVersion(\"code-agent\", {\n  kind: \"prompt\",\n  model: \"gpt-4o\",\n  instructions: \"You can execute code.\",\n  tools: [{ type: \"code_interpreter\", container: { type: \"auto\" } }]\n});\n\n\u002F\u002F File Search\nconst agent = await client.agents.createVersion(\"search-agent\", {\n  kind: \"prompt\",\n  model: \"gpt-4o\",\n  tools: [{ type: \"file_search\", vector_store_ids: [vectorStoreId] }]\n});\n\n\u002F\u002F Web Search\nconst agent = await client.agents.createVersion(\"web-agent\", {\n  kind: \"prompt\",\n  model: \"gpt-4o\",\n  tools: [{\n    type: \"web_search_preview\",\n    user_location: { type: \"approximate\", country: \"US\", city: \"Seattle\" }\n  }]\n});\n\n\u002F\u002F Azure AI Search\nconst agent = await client.agents.createVersion(\"aisearch-agent\", {\n  kind: \"prompt\",\n  model: \"gpt-4o\",\n  tools: [{\n    type: \"azure_ai_search\",\n    azure_ai_search: {\n      indexes: [{\n        project_connection_id: connectionId,\n        index_name: \"my-index\",\n        query_type: \"simple\"\n      }]\n    }\n  }]\n});\n\n\u002F\u002F Function Tool\nconst agent = await client.agents.createVersion(\"func-agent\", {\n  kind: \"prompt\",\n  model: \"gpt-4o\",\n  tools: [{\n    type: \"function\",\n    function: {\n      name: \"get_weather\",\n      description: \"Get weather for a location\",\n      strict: true,\n      parameters: {\n        type: \"object\",\n        properties: { location: { type: \"string\" } },\n        required: [\"location\"]\n      }\n    }\n  }]\n});\n\n\u002F\u002F MCP Tool\nconst agent = await client.agents.createVersion(\"mcp-agent\", {\n  kind: \"prompt\",\n  model: \"gpt-4o\",\n  tools: [{\n    type: \"mcp\",\n    server_label: \"my-mcp\",\n    server_url: \"https:\u002F\u002Fmcp-server.example.com\",\n    require_approval: \"always\"\n  }]\n});\n```\n\n### Run Agent\n\n```typescript\nconst openAIClient = await client.getOpenAIClient();\n\n\u002F\u002F Create conversation\nconst conversation = await openAIClient.conversations.create({\n  items: [{ type: \"message\", role: \"user\", content: \"Hello!\" }]\n});\n\n\u002F\u002F Generate response using agent\nconst response = await openAIClient.responses.create(\n  { conversation: conversation.id },\n  { body: { agent: { name: agent.name, type: \"agent_reference\" } } }\n);\n\n\u002F\u002F Cleanup\nawait openAIClient.conversations.delete(conversation.id);\nawait client.agents.deleteVersion(agent.name, agent.version);\n```\n\n## Connections\n\n```typescript\n\u002F\u002F List all connections\nfor await (const conn of client.connections.list()) {\n  console.log(conn.name, conn.type);\n}\n\n\u002F\u002F Get connection by name\nconst conn = await client.connections.get(\"my-connection\");\n\n\u002F\u002F Get connection with credentials\nconst connWithCreds = await client.connections.getWithCredentials(\"my-connection\");\n\n\u002F\u002F Get default connection by type\nconst defaultAzureOpenAI = await client.connections.getDefault(\"AzureOpenAI\", true);\n```\n\n## Deployments\n\n```typescript\n\u002F\u002F List all deployments\nfor await (const deployment of client.deployments.list()) {\n  if (deployment.type === \"ModelDeployment\") {\n    console.log(deployment.name, deployment.modelName);\n  }\n}\n\n\u002F\u002F Filter by publisher\nfor await (const d of client.deployments.list({ modelPublisher: \"OpenAI\" })) {\n  console.log(d.name);\n}\n\n\u002F\u002F Get specific deployment\nconst deployment = await client.deployments.get(\"gpt-4o\");\n```\n\n## Datasets\n\n```typescript\n\u002F\u002F Upload single file\nconst dataset = await client.datasets.uploadFile(\n  \"my-dataset\",\n  \"1.0\",\n  \".\u002Fdata\u002Ftraining.jsonl\"\n);\n\n\u002F\u002F Upload folder\nconst dataset = await client.datasets.uploadFolder(\n  \"my-dataset\",\n  \"2.0\",\n  \".\u002Fdata\u002Fdocuments\u002F\"\n);\n\n\u002F\u002F Get dataset\nconst ds = await client.datasets.get(\"my-dataset\", \"1.0\");\n\n\u002F\u002F List versions\nfor await (const version of client.datasets.listVersions(\"my-dataset\")) {\n  console.log(version);\n}\n\n\u002F\u002F Delete\nawait client.datasets.delete(\"my-dataset\", \"1.0\");\n```\n\n## Indexes\n\n```typescript\nimport { AzureAISearchIndex } from \"@azure\u002Fai-projects\";\n\nconst indexConfig: AzureAISearchIndex = {\n  name: \"my-index\",\n  type: \"AzureSearch\",\n  version: \"1\",\n  indexName: \"my-index\",\n  connectionName: \"search-connection\"\n};\n\n\u002F\u002F Create index\nconst index = await client.indexes.createOrUpdate(\"my-index\", \"1\", indexConfig);\n\n\u002F\u002F List indexes\nfor await (const idx of client.indexes.list()) {\n  console.log(idx.name);\n}\n\n\u002F\u002F Delete\nawait client.indexes.delete(\"my-index\", \"1\");\n```\n\n## Key Types\n\n```typescript\nimport {\n  AIProjectClient,\n  AIProjectClientOptionalParams,\n  Connection,\n  ModelDeployment,\n  DatasetVersionUnion,\n  AzureAISearchIndex\n} from \"@azure\u002Fai-projects\";\n```\n\n## Best Practices\n\n1. **Use getOpenAIClient()** - For responses, conversations, files, and vector stores\n2. **Version your agents** - Use `createVersion` for reproducible agent definitions\n3. **Clean up resources** - Delete agents, conversations when done\n4. **Use connections** - Get credentials from project connections, don't hardcode\n5. **Filter deployments** - Use `modelPublisher` filter to find specific models\n\n## When to Use\nThis skill is applicable to execute the workflow or actions described in the overview.\n\n## Limitations\n- Use this skill only when the task clearly matches the scope described above.\n- Do not treat the output as a substitute for environment-specific validation, testing, or expert review.\n- Stop and ask for clarification if required inputs, permissions, safety boundaries, or success criteria are missing.\n","","imported","https:\u002F\u002Fgithub.com\u002Fsickn33\u002Fantigravity-awesome-skills","user_system_seed","SkillOPIC",true,64,628,"2026-05-16 13:05:23",{"id":8,"name":21,"slug":22,"icon":23,"description":24,"sort":25,"createdAt":26},"编程开发","coding","mdi-code-braces","代码生成、调试、审查，提升开发效率",2,"2026-05-16 12:53:40",{"id":7,"name":28,"slug":29,"icon":30,"description":31,"moduleId":8,"sort":32,"skillCount":33,"createdAt":26},"DevOps","devops","mdi-cog-outline","CI\u002FCD、容器化、部署运维",3,162,[35],{"id":36,"skillId":4,"version":37,"fileName":38,"fileSize":39,"filePath":40,"fileHash":41,"manifest":42,"createdAt":19},"11e675c0-96b9-41f1-b242-7b8a5384565a","1.0.0","azure-ai-projects-ts.zip",2496,"uploads\u002Fskills\u002F023497af-af50-456e-8b0b-b46e924d8938\u002Fazure-ai-projects-ts.zip","48a5840e5b310236f34afbb08960d5c6807025bb666bfe75dae8ff4217a8b023","[{\"path\":\"SKILL.md\",\"isDirectory\":false,\"size\":7253}]",{"code":44,"message":45,"data":46},200,"success",{"items":47,"stats":48,"page":51},[],{"averageRating":49,"totalRatings":49,"ratingCounts":50},0,[49,49,49,49,49],{"limit":52,"offset":49,"hasMore":53,"nextOffset":52,"ratedOnly":16},15,false]