Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion classifiers/llm/gpt_classifier/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import openai
from litellm import completion
from pydantic import BaseModel
from typing import List

Expand Down Expand Up @@ -27,7 +28,7 @@ def gpt_classifier(req: GptClassifierModel):

openai.api_key = req.apiKey
try:
response = openai.ChatCompletion.create(
response = completion(
model="gpt-3.5-turbo",
messages=[
{
Expand Down
3 changes: 2 additions & 1 deletion extractors/llm/gpt_information_extraction/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import re
import ast
import openai
from litellm import completion
from extractors.util.spacy import SpacySingleton
from pydantic import BaseModel

Expand Down Expand Up @@ -28,7 +29,7 @@ def gpt_information_extraction(req: GptInformationExtractionModel):
"""Uses OpenAI's GPT model to extract keyword from a text."""
openai.api_key = req.apiKey
try:
response = openai.ChatCompletion.create(
response = completion(
model = "gpt-3.5-turbo",
messages = [
{
Expand Down
3 changes: 2 additions & 1 deletion generators/llm/gpt_grammar_correction/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import openai
from litellm import completion
from pydantic import BaseModel

INPUT_EXAMPLE = {
Expand All @@ -21,7 +22,7 @@ def gpt_grammar_correction(req: GptGrammarCorrectionModel):
"""GPT-3.5 model which can be used to correct grammar."""
openai.api_key = req.apiKey
try:
response = openai.ChatCompletion.create(
response = completion(
model="gpt-3.5-turbo",
messages=[
{
Expand Down
3 changes: 2 additions & 1 deletion generators/llm/gpt_tldr_summarization/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import openai
from pydantic import BaseModel
from litellm import completion

INPUT_EXAMPLE = {
"apiKey": "<API_KEY_GOES_HERE>",
Expand All @@ -21,7 +22,7 @@ def gpt_tldr_summarization(req: GptTldrSummarizationModel):
"""GPT-3.5 model which can be used to summarize text inputs."""
openai.api_key = req.apiKey
try:
response = openai.ChatCompletion.create(
response = completion(
model="gpt-3.5-turbo",
messages=[
{
Expand Down