ferruzzi opened a new pull request, #38602:
URL: https://github.com/apache/airflow/pull/38602

   Includes the basic doc page, hook, operator, unit tests, and system test.
   
   Currently only supports invoking one of the prebuilt "foundation" models. 
Custom model support is coming next.
   
   Sample DAG:
   ```
   from airflow.models import DAG
   from airflow.providers.amazon.aws.operators.bedrock import 
BedrockInvokeModelOperator
   from airflow.utils.dates import days_ago
   
   PROMPT = "What are the first ten digits of pi?"
   
   with DAG(
       dag_id="bedrock_testing",
       schedule_interval=None,
       start_date=days_ago(1)
   ) as dag:
   
       invoke_llama = BedrockInvokeModelOperator(
           task_id="invoke_llama",
           model_id="meta.llama2-13b-chat-v1",
           input_data={"prompt": PROMPT},
       )
    ```
    
    Log output from the above sample DAG run:
    
   
![image](https://github.com/apache/airflow/assets/1920178/b6f965c0-0cfc-4f7f-b8e1-c35b431531ee)
   
   Manually tested as a DAG in Breeze:
   
![image](https://github.com/apache/airflow/assets/1920178/393b622b-94b4-40b6-a8f0-158a0d54ba18)
   
   
   This is the generated doc page, for easier viewing:
   
![image](https://github.com/apache/airflow/assets/1920178/a3df3ecc-d05c-49d5-90d4-261a1718253e)
   The link at the bottom of that screenshot beings you 
[here](https://docs.aws.amazon.com/bedrock/latest/userguide/model-parameters.html)
   


-- 
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: commits-unsubscr...@airflow.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to