Skip to content

Commit

Permalink
update.
Browse files Browse the repository at this point in the history
  • Loading branch information
GarfieldDai committed Oct 18, 2023
1 parent e7a4a88 commit 19e13a0
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 8 deletions.
5 changes: 0 additions & 5 deletions api/core/model_providers/models/entity/model_params.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,6 @@
from langchain.load.serializable import Serializable
from pydantic import BaseModel

class AppMode(enum.Enum):
COMPLETION = 'completion'
CHAT = 'chat'


class ModelMode(enum.Enum):
COMPLETION = 'completion'
CHAT = 'chat'
Expand Down
7 changes: 6 additions & 1 deletion api/core/prompt/prompt_transform.py
Original file line number Diff line number Diff line change
@@ -1,15 +1,20 @@
import json
import os
import re
import enum
from typing import List, Optional, Tuple

from langchain.memory.chat_memory import BaseChatMemory
from core.model_providers.models.entity.model_params import ModelMode, AppMode
from core.model_providers.models.entity.model_params import ModelMode
from core.model_providers.models.entity.message import PromptMessage, MessageType, to_prompt_messages
from core.model_providers.models.llm.base import BaseLLM
from core.prompt.prompt_builder import PromptBuilder
from core.prompt.prompt_template import PromptTemplateParser

class AppMode(enum.Enum):
COMPLETION = 'completion'
CHAT = 'chat'

class PromptTransform:

def get_prompt(self, mode: str,
Expand Down
3 changes: 2 additions & 1 deletion api/services/advanced_prompt_template_service.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@

import copy

from core.model_providers.models.entity.model_params import AppMode, ModelMode
from core.model_providers.models.entity.model_params import ModelMode
from core.prompt.prompt_transform import AppMode
from core.prompt.advanced_prompt_templates import CHAT_APP_COMPLETION_PROMPT_CONFIG, CHAT_APP_CHAT_PROMPT_CONFIG, COMPLETION_APP_CHAT_PROMPT_CONFIG, COMPLETION_APP_COMPLETION_PROMPT_CONFIG, \
BAICHUAN_CHAT_APP_COMPLETION_PROMPT_CONFIG, BAICHUAN_CHAT_APP_CHAT_PROMPT_CONFIG, BAICHUAN_COMPLETION_APP_COMPLETION_PROMPT_CONFIG, BAICHUAN_COMPLETION_APP_CHAT_PROMPT_CONFIG, CONTEXT, BAICHUAN_CONTEXT

Expand Down
3 changes: 2 additions & 1 deletion api/services/app_model_config_service.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
import re
import uuid

from core.prompt.prompt_transform import AppMode
from core.agent.agent_executor import PlanningStrategy
from core.model_providers.model_provider_factory import ModelProviderFactory
from core.model_providers.models.entity.model_params import ModelType, ModelMode, AppMode
from core.model_providers.models.entity.model_params import ModelType, ModelMode
from models.account import Account
from services.dataset_service import DatasetService

Expand Down

0 comments on commit 19e13a0

Please sign in to comment.