{"record":{"id":"650e19c843273e98","repo":"microsoft/semantic-kernel","slug":"the-option-keys-asset-identifiers-and-asset-typ","errorCode":null,"errorMessage":"The option keys 'asset_identifiers' and 'asset_type' are required for a vector store data source.","messagePattern":"The option keys 'asset_identifiers' and 'asset_type' are required for a vector store data source\\.","errorType":"validation","errorClass":"ArgumentException","httpStatus":null,"severity":"error","filePath":"dotnet/src/Agents/AzureAI/Extensions/AgentToolDefinitionExtensions.cs","lineNumber":136,"sourceCode":"    internal static List<VectorStoreDataSource>? GetDataSources(this AgentToolDefinition agentToolDefinition)\n    {\n        var dataSources = agentToolDefinition.GetOption<List<object>?>(\"data_sources\");\n        return dataSources is not null ? CreateDataSources(dataSources) : null;\n    }\n\n    internal static List<VectorStoreDataSource> CreateDataSources(List<object> values)\n    {\n        List<VectorStoreDataSource> dataSources = [];\n        foreach (var value in values)\n        {\n            if (value is Dictionary<object, object> dataSourceDict)\n            {\n                string? assetIdentifier = dataSourceDict.TryGetValue(\"asset_identifier\", out var identifierValue) && identifierValue is string identifierString ? identifierString : null;\n                string? assetType = dataSourceDict.TryGetValue(\"asset_type\", out var typeValue) && typeValue is string typeString ? typeString : null;\n\n                if (string.IsNullOrEmpty(assetIdentifier) || string.IsNullOrEmpty(assetType))\n                {\n                    throw new ArgumentException(\"The option keys 'asset_identifier' and 'asset_type' are required for a vector store data source.\");\n                }\n\n                dataSources.Add(new VectorStoreDataSource(assetIdentifier, new VectorStoreDataSourceAssetType(assetType)));\n            }\n        }\n\n        return dataSources;\n    }\n\n    internal static IList<VectorStoreConfigurations>? GetVectorStoreConfigurations(this AgentToolDefinition agentToolDefinition)\n    {\n        var dataSources = agentToolDefinition.GetOption<List<object>?>(\"configurations\");\n        return dataSources is not null ? CreateVectorStoreConfigurations(dataSources) : null;\n    }\n\n    internal static List<VectorStoreConfigurations> CreateVectorStoreConfigurations(List<object> values)\n    {\n        List<VectorStoreConfigurations> configurations = [];","sourceCodeStart":118,"sourceCodeEnd":154,"githubUrl":"https://github.com/microsoft/semantic-kernel/blob/c028a0c7dc4f0814cdcbaba9d998f187a41197bf/dotnet/src/Agents/AzureAI/Extensions/AgentToolDefinitionExtensions.cs#L118-L154","documentation":"Thrown while building vector store data sources (CreateDataSources). Each data source dictionary must contain a non-empty 'asset_identifier' string and a non-empty 'asset_type' string; both are needed to construct a VectorStoreDataSource. Missing or empty either one throws ArgumentException.","triggerScenarios":"A vector store data source entry in tool options has asset_identifier but not asset_type, or the value is empty/non-string.","commonSituations":"Incomplete vector store upload config; typo in 'asset_identifier' vs 'asset_id'; asset type set to a non-string value.","solutions":["Provide both 'asset_identifier' (string) and 'asset_type' (string) for every data source entry.","Use a valid asset_type value recognized by VectorStoreDataSourceAssetType."],"exampleFix":"// before\ndata_sources:\n  - asset_identifier: 'file-abc123'\n    # asset_type missing -> throws 163\n\n// after\ndata_sources:\n  - asset_identifier: 'file-abc123'\n    asset_type: 'azure_blob_storage'","handlingStrategy":"validation","validationCode":"foreach (var v in values)\n{\n    if (v is not Dictionary<object, object> d) continue;\n    string? id = d.TryGetValue(\"asset_identifier\", out var i) && i is string s1 ? s1 : null;\n    string? type = d.TryGetValue(\"asset_type\", out var t) && t is string s2 ? s2 : null;\n    if (string.IsNullOrEmpty(id) || string.IsNullOrEmpty(type))\n        throw new ArgumentException(\"Each data source needs asset_identifier and asset_type.\");\n}","typeGuard":"static bool IsValidDataSource(Dictionary<object, object> d) =>\n    d.TryGetValue(\"asset_identifier\", out var i) && i is string si && !string.IsNullOrEmpty(si)\n    && d.TryGetValue(\"asset_type\", out var t) && t is string st && !string.IsNullOrEmpty(st);","tryCatchPattern":null,"preventionTips":["Provide both asset_identifier and asset_type for every data source.","Validate vector store tool config at load time."],"tags":["validation","vector-store","agent-tool","configuration"],"backgroundTag":null,"analyzedSha":"c028a0c7dc4f0814cdcbaba9d998f187a41197bf","analyzedAt":"2026-08-13T13:48:05.040Z","schemaVersion":2},"datasetVersion":"2026-08-13T14:17:21.547Z"}