# AzureCognitiveServicesProjectResource

- Module: [Aspire.Hosting.Foundry](/reference/api/typescript/aspire.hosting.foundry.md)
- Version: `13.4.0-preview.1.26281.18`
- Kind: `handle`
- Source: [GitHub](https://github.com/microsoft/aspire)

## Definition

```typescript
interface AzureCognitiveServicesProjectResource
  extends IAzureResource,
    IComputeEnvironmentResource,
    IExpressionValue,
    IManifestExpressionProvider,
    IResource,
    IResourceWithConnectionString,
    IResourceWithParameters,
    IResourceWithParent,
    FoundryResource]],
    IValueProvider,
    IValueWithReferences,
    IAzureComputeEnvironmentResource {
  addAISearchTool(
      name: string,
      indexName?: string): AzureAISearchToolResource;
  addAzureFunctionTool(
      name: string,
      functionName: string,
      description: string,
      parametersJson: string,
      inputQueueEndpoint: string,
      inputQueueName: string,
      outputQueueEndpoint: string,
      outputQueueName: string): AzureFunctionToolResource;
  addBingGroundingConnection(
      name: string,
      bingResourceId: string): BingGroundingConnectionResource;
  addBingGroundingConnectionFromParameter(
      name: string,
      bingResourceId: ParameterResource): BingGroundingConnectionResource;
  addBingGroundingTool(name: string): BingGroundingToolResource;
  addCapabilityHost(name: string): AzureCognitiveServicesProjectResource;
  addCodeInterpreterTool(name: string): CodeInterpreterToolResource;
  addComputerUseTool(
      name: string,
      displayWidth?: number,
      displayHeight?: number,
      environment?: string): ComputerToolResource;
  addConnection(resource: AzureKeyVaultResource): AzureCognitiveServicesProjectConnectionResource;
  addContainerRegistryConnection(registry: AzureContainerRegistryResource): AzureCognitiveServicesProjectConnectionResource;
  addCosmosConnection(db: AzureCosmosDBResource): AzureCognitiveServicesProjectConnectionResource;
  addFabricTool(
      name: string,
      projectConnectionIds: string[]): FabricToolResource;
  addFileSearchTool(
      name: string,
      vectorStoreIds: string[]): FileSearchToolResource;
  addFunctionTool(
      name: string,
      functionName: string,
      parametersJson: string,
      description?: string,
      strictModeEnabled?: boolean): FunctionToolResource;
  addImageGenerationTool(name: string): ImageGenerationToolResource;
  addKeyVaultConnection(keyVault: AzureKeyVaultResource): AzureCognitiveServicesProjectConnectionResource;
  addModelDeployment(
      name: string,
      model: FoundryModel|string,
      modelVersion?: string,
      format?: string): FoundryDeploymentResource;
  addPromptAgent(
      name: string,
      model: FoundryDeploymentResource,
      instructions?: string): AzurePromptAgentResource;
  addSearchConnection(search: AzureSearchResource): AzureCognitiveServicesProjectConnectionResource;
  addSharePointTool(
      name: string,
      projectConnectionIds: string[]): SharePointToolResource;
  addStorageConnection(storage: AzureStorageResource): AzureCognitiveServicesProjectConnectionResource;
  addWebSearchTool(name: string): WebSearchToolResource;
  withAppInsights(appInsights: AzureApplicationInsightsResource): AzureCognitiveServicesProjectResource;
  withCapabilityHost(resource: FoundryResource): AzureCognitiveServicesProjectResource;
  withKeyVault(keyVault: AzureKeyVaultResource): AzureCognitiveServicesProjectResource;
}
```

## Methods

- [addAISearchTool](/reference/api/typescript/aspire.hosting.foundry/azurecognitiveservicesprojectresource/addaisearchtool.md) -- `method` -- Adds an Azure AI Search tool to a Microsoft Foundry project, enabling agents to ground their responses using data from an Azure AI Search index.
    ```typescript
  addAISearchTool(name: string, indexName?: string): AzureAISearchToolResource
  ```
- [addAzureFunctionTool](/reference/api/typescript/aspire.hosting.foundry/azurecognitiveservicesprojectresource/addazurefunctiontool.md) -- `method` -- Adds an Azure Function tool to a Microsoft Foundry project, enabling agents to invoke a serverless Azure Function with queue-based input/output bindings.
    ```typescript
  addAzureFunctionTool(name: string, functionName: string, description: string, parametersJson: string, inputQueueEndpoint: string, inputQueueName: string, outputQueueEndpoint: string, outputQueueName: string): AzureFunctionToolResource
  ```
- [addBingGroundingConnection](/reference/api/typescript/aspire.hosting.foundry/azurecognitiveservicesprojectresource/addbinggroundingconnection.md) -- `method` -- Adds a Grounding with Bing Search connection to a Microsoft Foundry project.
    ```typescript
  addBingGroundingConnection(name: string, bingResourceId: string): BingGroundingConnectionResource
  ```
- [addBingGroundingConnectionFromParameter](/reference/api/typescript/aspire.hosting.foundry/azurecognitiveservicesprojectresource/addbinggroundingconnectionfromparameter.md) -- `method` -- Adds a Grounding with Bing Search connection to a Microsoft Foundry project using a parameter resource for the Bing resource ID.
    ```typescript
  addBingGroundingConnectionFromParameter(name: string, bingResourceId: ParameterResource): BingGroundingConnectionResource
  ```
- [addBingGroundingTool](/reference/api/typescript/aspire.hosting.foundry/azurecognitiveservicesprojectresource/addbinggroundingtool.md) -- `method` -- Adds a Bing Grounding tool to a Microsoft Foundry project, enabling agents to ground their responses using Bing Search results.
    ```typescript
  addBingGroundingTool(name: string): BingGroundingToolResource
  ```
- [addCapabilityHost](/reference/api/typescript/aspire.hosting.foundry/azurecognitiveservicesprojectresource/addcapabilityhost.md) -- `method` -- Adds a capability host to the Microsoft Foundry project.
    ```typescript
  addCapabilityHost(name: string): AzureCognitiveServicesProjectResource
  ```
- [addCodeInterpreterTool](/reference/api/typescript/aspire.hosting.foundry/azurecognitiveservicesprojectresource/addcodeinterpretertool.md) -- `method` -- Adds a Code Interpreter tool to a Microsoft Foundry project, enabling agents to write and run Python code in a sandboxed environment for data analysis, math, and chart generation.
    ```typescript
  addCodeInterpreterTool(name: string): CodeInterpreterToolResource
  ```
- [addComputerUseTool](/reference/api/typescript/aspire.hosting.foundry/azurecognitiveservicesprojectresource/addcomputerusetool.md) -- `method` -- Adds a Computer Use tool to a Microsoft Foundry project, enabling agents to interact with a computer desktop by taking screenshots, moving the mouse, clicking, and typing.
    ```typescript
  addComputerUseTool(name: string, displayWidth?: number, displayHeight?: number, environment?: string): ComputerToolResource
  ```
- [addConnection](/reference/api/typescript/aspire.hosting.foundry/azurecognitiveservicesprojectresource/addconnection.md) -- `method` -- Adds a connection to a Microsoft Foundry project.
    ```typescript
  addConnection(resource: AzureKeyVaultResource): AzureCognitiveServicesProjectConnectionResource
  ```
- [addContainerRegistryConnection](/reference/api/typescript/aspire.hosting.foundry/azurecognitiveservicesprojectresource/addcontainerregistryconnection.md) -- `method` -- Adds a container registry connection to the Microsoft Foundry project.
    ```typescript
  addContainerRegistryConnection(registry: AzureContainerRegistryResource): AzureCognitiveServicesProjectConnectionResource
  ```
- [addCosmosConnection](/reference/api/typescript/aspire.hosting.foundry/azurecognitiveservicesprojectresource/addcosmosconnection.md) -- `method` -- Adds CosmosDB to a project as a connection
    ```typescript
  addCosmosConnection(db: AzureCosmosDBResource): AzureCognitiveServicesProjectConnectionResource
  ```
- [addFabricTool](/reference/api/typescript/aspire.hosting.foundry/azurecognitiveservicesprojectresource/addfabrictool.md) -- `method` -- Adds a Microsoft Fabric data agent tool to a Microsoft Foundry project, enabling agents to query data through Fabric data agents.
    ```typescript
  addFabricTool(name: string, projectConnectionIds: string[]): FabricToolResource
  ```
- [addFileSearchTool](/reference/api/typescript/aspire.hosting.foundry/azurecognitiveservicesprojectresource/addfilesearchtool.md) -- `method` -- Adds a File Search tool to a Microsoft Foundry project, enabling agents to search uploaded files and proprietary documents using vector search.
    ```typescript
  addFileSearchTool(name: string, vectorStoreIds: string[]): FileSearchToolResource
  ```
- [addFunctionTool](/reference/api/typescript/aspire.hosting.foundry/azurecognitiveservicesprojectresource/addfunctiontool.md) -- `method` -- Adds a function calling tool to a Microsoft Foundry project, enabling agents to call application-defined functions with structured parameters.
    ```typescript
  addFunctionTool(name: string, functionName: string, parametersJson: string, description?: string, strictModeEnabled?: boolean): FunctionToolResource
  ```
- [addImageGenerationTool](/reference/api/typescript/aspire.hosting.foundry/azurecognitiveservicesprojectresource/addimagegenerationtool.md) -- `method` -- Adds an Image Generation tool to a Microsoft Foundry project, enabling agents to generate and edit images.
    ```typescript
  addImageGenerationTool(name: string): ImageGenerationToolResource
  ```
- [addKeyVaultConnection](/reference/api/typescript/aspire.hosting.foundry/azurecognitiveservicesprojectresource/addkeyvaultconnection.md) -- `method` -- Adds a Key Vault connection to the Microsoft Foundry project.
    ```typescript
  addKeyVaultConnection(keyVault: AzureKeyVaultResource): AzureCognitiveServicesProjectConnectionResource
  ```
- [addModelDeployment](/reference/api/typescript/aspire.hosting.foundry/azurecognitiveservicesprojectresource/addmodeldeployment.md) -- `method` -- Adds a model deployment to the parent Microsoft Foundry resource.
    ```typescript
  addModelDeployment(name: string, model: FoundryModel|string, modelVersion?: string, format?: string): FoundryDeploymentResource
  ```
- [addPromptAgent](/reference/api/typescript/aspire.hosting.foundry/azurecognitiveservicesprojectresource/addpromptagent.md) -- `method` -- Adds a prompt agent to a Microsoft Foundry project with the specified tools.
    ```typescript
  addPromptAgent(name: string, model: FoundryDeploymentResource, instructions?: string): AzurePromptAgentResource
  ```
- [addSearchConnection](/reference/api/typescript/aspire.hosting.foundry/azurecognitiveservicesprojectresource/addsearchconnection.md) -- `method` -- Adds an Azure AI Search connection to a Microsoft Foundry project.
    ```typescript
  addSearchConnection(search: AzureSearchResource): AzureCognitiveServicesProjectConnectionResource
  ```
- [addSharePointTool](/reference/api/typescript/aspire.hosting.foundry/azurecognitiveservicesprojectresource/addsharepointtool.md) -- `method` -- Adds a SharePoint grounding tool to a Microsoft Foundry project, enabling agents to search data from SharePoint sites configured as Foundry project connections.
    ```typescript
  addSharePointTool(name: string, projectConnectionIds: string[]): SharePointToolResource
  ```
- [addStorageConnection](/reference/api/typescript/aspire.hosting.foundry/azurecognitiveservicesprojectresource/addstorageconnection.md) -- `method` -- Adds an Azure Storage account to a project as a connection.
    ```typescript
  addStorageConnection(storage: AzureStorageResource): AzureCognitiveServicesProjectConnectionResource
  ```
- [addWebSearchTool](/reference/api/typescript/aspire.hosting.foundry/azurecognitiveservicesprojectresource/addwebsearchtool.md) -- `method` -- Adds a Web Search tool to a Microsoft Foundry project, enabling agents to retrieve real-time information from the public web and return answers with inline citations.
    ```typescript
  addWebSearchTool(name: string): WebSearchToolResource
  ```
- [withAppInsights](/reference/api/typescript/aspire.hosting.foundry/azurecognitiveservicesprojectresource/withappinsights.md) -- `method` -- Adds an Application Insights resource to the Microsoft Foundry project, overriding the default (which is to create a new Application Insights resource).
    ```typescript
  withAppInsights(appInsights: AzureApplicationInsightsResource): AzureCognitiveServicesProjectResource
  ```
- [withCapabilityHost](/reference/api/typescript/aspire.hosting.foundry/azurecognitiveservicesprojectresource/withcapabilityhost.md) -- `method` -- Associates a supported resource with a capability host on a Microsoft Foundry project.
    ```typescript
  withCapabilityHost(resource: FoundryResource): AzureCognitiveServicesProjectResource
  ```
- [withKeyVault](/reference/api/typescript/aspire.hosting.foundry/azurecognitiveservicesprojectresource/withkeyvault.md) -- `method` -- Adds a Key Vault connection to the Microsoft Foundry project.
    ```typescript
  withKeyVault(keyVault: AzureKeyVaultResource): AzureCognitiveServicesProjectResource
  ```
