OpenAI API を使った AI システムの開発
Francesca Donadoni
Curriculum Manager, DataCamp
「弊社では、カリフォルニア州サンフランシスコ本社の革新的なチームに加入する、スキルの高いデータサイエンティストを現在募集しています。 この役割では、当社の戦略的意思決定を支える複雑なデータ分析とモデリングプロジェクトに取り組む機会があります。 要件: 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"}
OpenAI API を使った AI システムの開発