LLM Study

Part ChatGPT 4o ChatGPT 4o API demo from openai import OpenAI model_use = "gpt-4o-2024-08-06" client = OpenAI(api_key="Your-API-key") completion = client.beta.chat.completions.parse( model=model_use, messages=[ {"role": "system", "content": "Extract the event information."}, {"role": "user", "content": "Alice and Bob are going to a science fair on Friday."}, ], ) event = completion.choices[0].message.parsed Note: I tried to use model “gpt-4o” but failed. How to create ChatGPT API Key Log in to openai Use the search bar to search “API keys” Create a new secret key (Shown only once, invisible after closing the tab) Go to billing to add some credit to the account Part UniTox ChatGPT Read from fda.gov Read the label of the drug we are interested in from a .csv file. ...

January 1, 2025 · 2 min