Amazon Bedrock เป็นวิธีที่ง่ายที่สุดในการสร้างและปรับขนาดแอพพลิเคชั่น AI แบบกำเนิดด้วยโมเดลพื้นฐาน (FMS) ใน AWS FMS ได้รับการฝึกฝนเกี่ยวกับข้อมูลจำนวนมากทำให้พวกเขาสามารถใช้เพื่อตอบคำถามเกี่ยวกับวิชาที่หลากหลาย อย่างไรก็ตามหากคุณต้องการใช้ FM เพื่อตอบคำถามเกี่ยวกับข้อมูลส่วนตัวของคุณที่คุณเก็บไว้ใน Bucket Storage Simple Simple Storage (Amazon S3) หรือ Amazon Aurora PostgreSQL ที่เข้ากันได้กับฐานข้อมูลรุ่นที่เข้ากันได้คุณต้องใช้เทคนิคที่เรียกว่า

ในฐานะที่เป็นไฟล์ทดสอบจะใช้การสอน PostgreSQL PDF
คุณต้องขอการเข้าถึงโมเดลก่อนที่จะใช้งาน หากคุณพยายามใช้โมเดล (ด้วย API หรือคอนโซล) ก่อนที่คุณจะขอการเข้าถึงคุณจะได้รับข้อความแสดงข้อผิดพลาด สำหรับข้อมูลเพิ่มเติมดูการเข้าถึงแบบจำลอง
ในคอนโซล AWS ให้เลือกภูมิภาคที่คุณต้องการเข้าถึงอเมซอน เราขอแนะนำให้ใช้ภูมิภาค US-East-1 (N. Virginia) ที่มีทุกรุ่นที่มีอยู่

ค้นหา พื้นหินอเมซอน โดยค้นหาในคอนโซล AWS

ขยายเมนูด้านข้างและเลือก การเข้าถึงรุ่น

เลือกปุ่ม แก้ไข
ใช้ช่องทำเครื่องหมายเพื่อเลือกรุ่นที่คุณต้องการเปิดใช้งาน แนวทางนี้ต้องใช้ Titan Text Embeddings V2 และ Claude 3.5 Sonnet Models คลิก บันทึกการเปลี่ยนแปลง เพื่อเปิดใช้งานโมเดลในบัญชีของคุณ โปรดทดสอบกับรุ่นอื่น ๆ หากคุณต้องการ
รอจนกว่ารุ่นจะพร้อมใช้งาน

git clone [email protected]:set-university/genai-workshops.git cd workshop4terraform initterraform getterraform plan
terraform apply --auto-approve ไปที่ข้อเท็จจริงบริการใน AWS Console
คลิก ฐานความรู้ รายการเมนู NAV ซ้าย
คลิกฐานความรู้ที่สร้างขึ้นผ่าน Terraform

เลือกแหล่งข้อมูล S3 และคลิก * ปุ่ม ซิงค์

รอให้เสร็จสิ้นการซิงค์ (~ 5-10 นาที)
ทำตามตัวอย่างด้านล่างและแทนที่ {your-lambda-url} ด้วย URL แลมบ์ดาของคุณจากขั้นตอนที่ 8 ของการปรับใช้
curl -X POST ' https://{your-lambda-url}/ '
-H ' content-type: application/json '
-d ' { "prompt": "what are the postgres versions?" } 'การตอบสนองอาจมีลักษณะดังนี้:
{"genai_response": "Current PostgreSQL version numbers consist of a major and a minor version number. For example, in version 10.1, 10 is the major version and 1 is the minor version. This indicates it's the first minor release of major version 10.nnFor PostgreSQL versions before 10.0, the version numbers consisted of three numbers, such as 9.5.3. In these cases, the major version is represented by the first two digit groups (e.g., 9.5), and the minor version is the third number (e.g., 3).nnMinor releases are always compatible with earlier and later minor releases of the same major version. For instance, version 10.1 is compatible with 10.0 and 10.6. Similarly, 9.5.3 is compatible with 9.5.0, 9.5.1, and 9.5.6."}
terraform destroy
# type 'yes' to confirm