-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update diffs for rohittp0/AutoREPL at Thu Apr 11 17:10:09 UTC 2024
- Loading branch information
github-actions
committed
Apr 11, 2024
1 parent
cdaf096
commit 2377789
Showing
1 changed file
with
28 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
diff --git a/models/gpt.py b/models/gpt.py | ||
index a416678..f2c1fee 100644 | ||
--- a/models/gpt.py | ||
+++ b/models/gpt.py | ||
@@ -25,4 +25,4 @@ class GPT(Model): | ||
messages=messages | ||
) | ||
|
||
- return response["choices"][0]["message"]["content"] | ||
+ return response.choices[0].message.content | ||
diff --git a/tests/gpt_test.py b/tests/gpt_test.py | ||
new file mode 100644 | ||
index 0000000..0111990 | ||
--- /dev/null | ||
+++ b/tests/gpt_test.py | ||
@@ -0,0 +1,12 @@ | ||
+from models.gpt import GPT | ||
+ | ||
+ | ||
+def returns_response(): | ||
+ gpt = GPT(True) | ||
+ response = gpt.query("Hello, how are you?", "") | ||
+ | ||
+ assert response is not None | ||
+ | ||
+ | ||
+if __name__ == "__main__": | ||
+ returns_response() |