Разработка ИИ-систем с помощью OpenAI API
Francesca Donadoni
Curriculum Manager, DataCamp
«Мы ищем опытного специалиста по данным в нашу команду. Работа в главном офисе компании в Сан-Франциско, штат Калифорния. Вы будете участвовать в сложных проектах по анализу данных и моделированию, влияющих на стратегические решения компании. Требования: не менее 3 лет опыта в области Data Science с использованием Python и AWS, Azure или GCP.»
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