matiasbonfanti commited on
Commit
e9c33cf
1 Parent(s): 0ae232f

new file: openai.ipynb

Browse files
Files changed (2) hide show
  1. openai.ipynb +54 -0
  2. requirements.txt +1 -0
openai.ipynb ADDED
@@ -0,0 +1,54 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "cells": [
3
+ {
4
+ "cell_type": "code",
5
+ "execution_count": null,
6
+ "metadata": {},
7
+ "outputs": [],
8
+ "source": [
9
+ "import os\n",
10
+ "import openai\n",
11
+ "\n",
12
+ "openai.api_key = \"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\"\n",
13
+ "\n",
14
+ "response = openai.Completion.create(\n",
15
+ " model=\"text-davinci-003\",\n",
16
+ " prompt=\"Summarize this for a second-grade student:\\n\\nJupiter is the fifth planet from the Sun and the largest in the Solar System. It is a gas giant with a mass one-thousandth that of the Sun, but two-and-a-half times that of all the other planets in the Solar System combined. Jupiter is one of the brightest objects visible to the naked eye in the night sky, and has been known to ancient civilizations since before recorded history. It is named after the Roman god Jupiter.[19] When viewed from Earth, Jupiter can be bright enough for its reflected light to cast visible shadows,[20] and is on average the third-brightest natural object in the night sky after the Moon and Venus.\",\n",
17
+ " temperature=0.7,\n",
18
+ " max_tokens=64,\n",
19
+ " top_p=1.0,\n",
20
+ " frequency_penalty=0.0,\n",
21
+ " presence_penalty=0.0\n",
22
+ ")\n",
23
+ "\n",
24
+ "print(response)\n"
25
+ ]
26
+ },
27
+ {
28
+ "cell_type": "code",
29
+ "execution_count": null,
30
+ "metadata": {},
31
+ "outputs": [],
32
+ "source": []
33
+ }
34
+ ],
35
+ "metadata": {
36
+ "kernelspec": {
37
+ "display_name": "Python 3.11.0 64-bit",
38
+ "language": "python",
39
+ "name": "python3"
40
+ },
41
+ "language_info": {
42
+ "name": "python",
43
+ "version": "3.11.0"
44
+ },
45
+ "orig_nbformat": 4,
46
+ "vscode": {
47
+ "interpreter": {
48
+ "hash": "44d17221d46c7a46e8a7a9f0d7c8ef78bb19f39bfba305b8bd07282139afb75c"
49
+ }
50
+ }
51
+ },
52
+ "nbformat": 4,
53
+ "nbformat_minor": 2
54
+ }
requirements.txt ADDED
@@ -0,0 +1 @@
 
 
1
+ openai