Vývoj AI systémů s OpenAI API
Francesca Donadoni
Curriculum Manager, DataCamp
"Hledáme zkušeného datového vědce, který se připojí k našemu inovativnímu týmu v centrále společnosti v San Franciscu, CA. V této roli budete pracovat na komplexních projektech analýzy dat a modelování, které řídí naše strategická rozhodnutí. Požadavky: Minimálně 3 roky zkušeností v oblasti datové vědy s Pythonem a AWS, Azure nebo 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"}
Vývoj AI systémů s OpenAI API