Bought a ChatGPT account with API use permit. Learn something about it.
OpenAI API Study 0
Set API key
1 | import os |
or
1 | import openai |
Pricing with Tokens
OpenAI uses “Token” to count the price. It’s a NLP theory actually.
You can use the site below to see how a sentence or a word is tokenized.
But, due to the limitation that GPT-3.5-turbo doesn’t have a memory system, contents and tokens will increase if you continue chatting with GPT in one context with the intention of keeping memory states.
Use tiktoken module to count tokens
1 | import tiktoken |
OpenAI Chat completion API 入门指南 - 知乎 (zhihu.com)
Nekomusume(catgirl) based on OpenAI
如何将chatgpt调教成猫娘 - 知乎 (zhihu.com)
https://www.bilibili.com/video/BV1WP4y1D7FN
Reference
用Python调用OpenAI API做有趣的事_openai python_何小有的博客-CSDN博客
OpenAI API 代理 (openai-proxy.com)
OpenAI API 进阶使用指南01 - 知乎 (zhihu.com)
OpenAI Q&A: Finetuning GPT-3 vs Semantic Search - which to use, when, and why? - YouTube
Quickstart Guide — 🦜🔗 LangChain 0.0.161
liaokongVFX/LangChain-Chinese-Getting-Started-Guide: LangChain 的中文入门教程 (github.com)
- 本文作者: Taardis
- 本文链接: https://taardisaa.github.io/2023/04/23/OpenAI-API-Study-0/
- 版权声明: 本博客所有文章除特别声明外,均采用 Apache License 2.0 许可协议。转载请注明出处!