การพัฒนาระบบ AI ด้วย OpenAI API
Francesca Donadoni
Curriculum Manager, DataCamp
"ขณะนี้เรากำลังมองหา Data Scientist ที่มีทักษะสูงมาร่วมทีมที่สำนักงานใหญ่ของบริษัทในซานฟรานซิสโก รัฐแคลิฟอร์เนีย ในบทบาทนี้ คุณจะได้ทำงานกับโปรเจกต์วิเคราะห์ข้อมูลและสร้างโมเดลที่ซับซ้อน ซึ่งช่วยขับเคลื่อนการตัดสินใจเชิงกลยุทธ์ของเรา คุณสมบัติ: ประสบการณ์ด้าน data science กับ Python และ AWS, Azure หรือ GCP อย่างน้อย 3 ปี"
from openai import OpenAI client = OpenAI(api_key="ENTER YOUR KEY HERE") response= client.chat.completions.create( model="gpt-4o-mini", messages=messages,tools=function_definition,)
function_definition = [{'type': 'function','function': {'name': 'extract_job_info', 'description': 'Get the job information from the body of the input text', 'parameters': { ...}}]
function_definition = [{ 'type': 'function', 'function': { 'name': 'extract_job_info', 'description': 'Get the job information from the body of the input text','parameters': {'type': 'object', 'properties': 'job': {'type': 'string', 'description': 'Job title'}, 'location': {'type': 'string', 'description': 'Office location'}, ... }}]
response= client.chat.completions.create( model="gpt-4o-mini", messages=messages, tools=function_definition )print(response.choices[0].message.tool_calls[0].function.arguments)
{"job":"Data Scientist","location":"San Francisco, CA"}
การพัฒนาระบบ AI ด้วย OpenAI API