Merge pull request #60 from logspace-ai/add_constants_file
This commit is contained in:
commit
8dc5aeec37
3 changed files with 12 additions and 3 deletions
|
|
@ -1,6 +1,5 @@
|
|||
import multiprocessing
|
||||
import platform
|
||||
import re
|
||||
|
||||
from langflow.main import create_app
|
||||
|
||||
|
|
|
|||
8
src/backend/langflow/utils/constants.py
Normal file
8
src/backend/langflow/utils/constants.py
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
OPENAI_MODELS = [
|
||||
"text-davinci-003",
|
||||
"text-davinci-002",
|
||||
"text-curie-001",
|
||||
"text-babbage-001",
|
||||
"text-ada-001",
|
||||
]
|
||||
CHAT_OPENAI_MODELS = ["gpt-3.5-turbo", "gpt-4", "gpt-4-32k"]
|
||||
|
|
@ -11,6 +11,8 @@ from langchain.agents.load_tools import (
|
|||
)
|
||||
from typing import Optional, Dict
|
||||
|
||||
from langflow.utils import constants
|
||||
|
||||
|
||||
def build_template_from_function(name: str, type_to_loader_dict: Dict):
|
||||
classes = [
|
||||
|
|
@ -296,9 +298,9 @@ def format_dict(d, name: Optional[str] = None):
|
|||
|
||||
# Add options to openai
|
||||
if name == "OpenAI" and key == "model_name":
|
||||
value["options"] = ["text-davinci-003", "text-davinci-002"]
|
||||
value["options"] = constants.OPENAI_MODELS
|
||||
elif name == "OpenAIChat" and key == "model_name":
|
||||
value["options"] = ["gpt-3.5-turbo", "gpt-4"]
|
||||
value["options"] = constants.CHAT_OPENAI_MODELS
|
||||
|
||||
return d
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue