codewithsanjay-pixel opened a new pull request, #77843:
URL: https://github.com/apache/airflow/pull/77843

   ### What this PR does
   Fixes #72592
   
   `BedrockCreateKnowledgeBaseOperator` currently hardcodes 
`knowledgeBaseConfiguration` to type `VECTOR` and always requires 
`embedding_model_arn` and `storage_config`. This breaks for managed knowledge 
bases (e.g. Kendra-backed) which don't use a vector store or embedding model.
   
   ### Changes
   - Add `knowledge_base_config` parameter for full 
`knowledgeBaseConfiguration` control
   - Make `embedding_model_arn` and `storage_config` optional (not needed for 
managed KBs)
   - Only pass `storageConfiguration` to the API when `storage_config` is 
provided (fixes `TypeError: got multiple values for keyword argument` when 
using `create_knowledge_base_kwargs`)
   - Skip the vector index retry loop for non-VECTOR knowledge base types
   - Raise `ValueError` if neither `knowledge_base_config` nor 
`embedding_model_arn` is given
   
   ### Example usage
   ```python
   # Managed knowledge base — no embedding model or storage config needed
   BedrockCreateKnowledgeBaseOperator(
       task_id="create_kendra_kb",
       name="my-kb",
       role_arn="arn:aws:iam::123:role/Role",
       knowledge_base_config={
           "type": "KENDRA",
           "kendraKnowledgeBaseConfiguration": {"kendraIndex": "my-index"},
       },
   )
   ```


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to