LLM 学习笔记

ChatGPT 4o 部分 ChatGPT 4o API 示例 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 注意:我尝试使用模型 “gpt-4o” 但未成功。 如何创建 ChatGPT API Key 登录 openai 使用搜索栏搜索 “API keys” 创建一个新的密钥(仅显示一次,关闭标签页后不可见) 前往账单页面为账户充值 UniTox ChatGPT 部分 从 fda.gov 读取数据 从 .csv 文件中读取我们感兴趣的药物标签。 读取页面上的 .html 文件或 .pdf 文件。 通过 ChatGPT 对 .html 和 .pdf 文件生成摘要。 利用 ChatGPT 生成的摘要,让 ChatGPT 判断该药物是否具有毒性,以及毒性程度。 ...

2025年1月1日 · 2 分钟