From 0b8f2500d1c7f80564ae9374e198ce34d7c93512 Mon Sep 17 00:00:00 2001 From: miteruzo Date: Thu, 30 Nov 2023 19:30:18 +0900 Subject: [PATCH] =?UTF-8?q?connection=20=E3=83=95=E3=82=A1=E3=82=A4?= =?UTF-8?q?=E3=83=AB=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 2 ++ connection.sample.py | 7 +++++++ talk.py | 16 ++++++++++++++++ 3 files changed, 25 insertions(+) create mode 100644 .gitignore create mode 100644 connection.sample.py create mode 100644 talk.py diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..314582d --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +/connection.py + diff --git a/connection.sample.py b/connection.sample.py new file mode 100644 index 0000000..7887116 --- /dev/null +++ b/connection.sample.py @@ -0,0 +1,7 @@ +# 各変数に適切な値を設定し,ファイル名を connection.py として保存すること + +OPENAI_ORGANISATION = 'org-XXXXXXXXXXXXXXXXXXXXXXXX' \ + # Organisation ID +OPENAI_API_KEY = 'sk-XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX' \ + # API Key + diff --git a/talk.py b/talk.py new file mode 100644 index 0000000..97ee334 --- /dev/null +++ b/talk.py @@ -0,0 +1,16 @@ +from connection import * + +import sys +import openai + + +class Talk: + @classmethod + def main (message: str) -> None: + openai.organization = OPENAI_ORGANISATION + openai.api_key = OPENAI_API_KEY + + +if __name__ == '__main__': + Talk.main (sys.argv[1]) +