Entwicklung von KI-Systemen mit der OpenAI-API
Francesca Donadoni
Curriculum Manager, DataCamp
"Wir suchen eine:n erfahrene:n Data Scientist für unser innovatives Team am Firmensitz in San Francisco, CA. In dieser Rolle arbeitest du an komplexen Analysen und Modellierungsprojekten, die unsere Strategie vorantreiben. Anforderungen: Mindestens 3 Jahre Erfahrung in Data Science mit Python sowie AWS, Azure oder 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"}
Entwicklung von KI-Systemen mit der OpenAI-API