开启跨境电商第一步
前段时间在有一个很火的儿童玩具,那么对于我们这样的新手想要在国外出售卖类似儿童玩具该明确哪些因素呢?
1.首先就是调研市场,确定你要售卖的商品和你想要售卖的地区
2.将语言转换翻译成你售卖地区的官方语言(AI代码)
3.合理定价 (用openai大模型扮演经济学家给出合理定价)
4.写文案(给OpenAI提供prompt,prompt engineer)
认识OpenAI
AI应用
- 大都是基于其提供的大模型,也是其最值钱的内容
- 在这里我们选择OPENAI的达芬奇模型常量,因为其擅长文本处理
花销
- 每当我们向AI询问问题并得到答案其实都要消耗AI应用的tokens(算力)
- 简而言之,越简单的问题消耗的tokens越少,越有价值的问题询问所花费的tokens越多
API_KEY
- 即 API 密钥,我们每个人都可以生成一个自己的API_KEY,也可以借用别人的。它是赋予某种形式的秘密令牌的名称,与 Web 服务(或类似的)请求一起提交以识别请求的来源。
准备工作(工具)
- 一个Google账号(www.google.com/)
- 一个OpenAI账号 (openai.com/)
- 打开OpenAI输入我们写的模板 得到输出结果
- 生成一个APIKey (在下面会告诉大家步骤)
- Colab网站:(colab.research.google.com/notebooks/w…
- 在Colab中输入另一个模板 得到最终结果
OpenAI模板
首先打开OpenAI然后输入
Consideration product:工厂现货PVC充气青蛙夜市地摊热卖充气玩具发光蛙儿童水上玩具
- Compose human readable product title used on Amazon in english within 20 words
- Write 5 selling points for the products in Amazon
- Evaluat a price range for this product in U.S
Output the result in json format with three properties called title, selling_points and price_range
OpenAI的输出如下
{
"title": "Factory Stock PVC Inflatable Frog Night Market Bestselling Glow-in-the-Dark Frog Children's Water Toy",
"selling_points": [
"High-Quality PVC Material",
"Unique Glow-in-the-Dark Feature",
"Perfect for Night Markets and Stalls",
"Fun and Safe Water Play for Kids",
"Ready to Ship from the Factory"
],
"price_range": "24.99"
}
创建一个API Key
- 在我们的OpenAI界面登录
- 点击进入API页面
- 浏览 API Key
- 生成一个API Key 并且复制下来
Colab 模板
import openai
openai.api_key = "输入你的API_Key" #openai 的sdk
COMPLETION_MODEL = "text-davinci-003" #模型常量 达芬奇 完成
# 输出的格式(openai 模板)
prompt = """
Consideration product:工厂现货PVC充气青蛙夜市地摊热卖充气玩具发光蛙儿童水上玩具
1.Compose human readable product title used on Amazon in english within 20 words
2.Write 5 selling points for the products in Amazon
3.Evalue a price range for this product in U.S
Output the result in json format with three properties called title,
selling points and price_range
"""
# 定义函数
def get_response(prompt):
completions = openai.Completion.create(
engine=COMPLETION_MODEL, # 模型
prompt = prompt, # 提示词
max_tokens=512, #省点
n = 1, # 1条
stop = None,
temperature = 0.0 # 自由发挥度 0-2
)
# print(completions)
message = completions.choices[0].text
return message
print(get_response(prompt))
- 打开Colab 创建一个新文件
- 输入代码 安装 openai 点击运行
- 安装成功
- 再点击添加代码 输入我们的Colab模板并运行
- 运行成功 得到输出结果
结语
恭喜你已经掌握了如何使用openAI以及Colab来实现成为跨境电商超人的第一步,不仅如此,聪明的你此时肯定有更多的想法关于去使用openAI发现更多新大陆,将从此改变以往的工作模式,大大提高你的工作效率,祝你成功!!!
感谢阅读 辛苦点个赞呗♥
开源Git仓库: gitee.com/cheng-bingw…
更多内容:从新手到大厂程序员 大厂如何写优质代码