{"record":{"id":"bd9be1d1622f61ca","repo":"weaviate/weaviate","slug":"could-not-get-request-metadata-for-provider-s-fr","errorCode":null,"errorMessage":"could not get request metadata for provider: %s from results: %+v","messagePattern":"could not get request metadata for provider: (.+?) from results: %\\+v","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"adapters/handlers/grpc/v1/generative/replier.go","lineNumber":207,"sourceCode":"\t\t\t\tcohere.BilledUnits = &pb.GenerativeCohereMetadata_BilledUnits{\n\t\t\t\t\tInputTokens:     params.Meta.BilledUnits.InputTokens,\n\t\t\t\t\tOutputTokens:    params.Meta.BilledUnits.OutputTokens,\n\t\t\t\t\tSearchUnits:     params.Meta.BilledUnits.SearchUnits,\n\t\t\t\t\tClassifications: params.Meta.BilledUnits.Classifications,\n\t\t\t\t}\n\t\t\t}\n\t\t\tif params.Meta.Tokens != nil {\n\t\t\t\tcohere.Tokens = &pb.GenerativeCohereMetadata_Tokens{\n\t\t\t\t\tInputTokens:  params.Meta.Tokens.InputTokens,\n\t\t\t\t\tOutputTokens: params.Meta.Tokens.OutputTokens,\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tmetadata.Kind = &pb.GenerativeMetadata_Cohere{Cohere: cohere}\n\tcase mistralParams.Name:\n\t\tparams := mistralClients.GetResponseParams(results)\n\t\tif params == nil {\n\t\t\treturn nil, fmt.Errorf(\"could not get request metadata for provider: %s from results: %+v\", providerName, results)\n\t\t}\n\t\tmistral := &pb.GenerativeMistralMetadata{}\n\t\tif params.Usage != nil {\n\t\t\tmistral.Usage = &pb.GenerativeMistralMetadata_Usage{\n\t\t\t\tPromptTokens:     convertIntPtrToInt64Ptr(params.Usage.PromptTokens),\n\t\t\t\tCompletionTokens: convertIntPtrToInt64Ptr(params.Usage.CompletionTokens),\n\t\t\t\tTotalTokens:      convertIntPtrToInt64Ptr(params.Usage.TotalTokens),\n\t\t\t}\n\t\t}\n\t\tmetadata.Kind = &pb.GenerativeMetadata_Mistral{Mistral: mistral}\n\tcase ollamaParams.Name:\n\t\t// Do nothing, no metadata for Ollama\n\tcase openaiParams.Name:\n\t\tparams := openaiClients.GetResponseParams(results)\n\t\tif params == nil {\n\t\t\treturn nil, fmt.Errorf(\"could not get request metadata for provider: %s\", providerName)\n\t\t}\n\t\topenai := &pb.GenerativeOpenAIMetadata{}","sourceCodeStart":189,"sourceCodeEnd":225,"githubUrl":"https://github.com/weaviate/weaviate/blob/75aa4b6d11f8818305aafd4440b4e32794f7ca04/adapters/handlers/grpc/v1/generative/replier.go#L189-L225","documentation":"Error emitted by extractGenerativeMetadata when type-asserting the results payload to the provider-specific params type fails (provider recognized, but the result object is not the expected concrete type). This indicates a module returned an unexpected result type — a programming/version inconsistency between the generative module and the replier. The failing provider and the raw results are included.","triggerScenarios":"Thrown at adapters/handlers/grpc/v1/generative/replier.go:207 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Check for a version mismatch between the generative module and the server","Report as a bug with the provider name and result shape"],"exampleFix":null,"handlingStrategy":"fallback","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"75aa4b6d11f8818305aafd4440b4e32794f7ca04","analyzedAt":"2026-09-04T14:58:20.392Z","contentChangedAt":"2026-09-04T14:58:20.392Z","schemaVersion":2},"datasetVersion":"2026-09-11T21:17:09.523Z"}