[feat] remove model init instruction
This commit is contained in:
parent
bd1dec4800
commit
bf3871b11e
1 changed files with 4 additions and 5 deletions
7
app.py
7
app.py
|
@ -18,11 +18,11 @@ SESSION_CACHE = LRUCache(15)
|
|||
logging.basicConfig(format='%(levelname)s:%(message)s', level=logging.DEBUG)
|
||||
|
||||
|
||||
def generate(model: str, instruction: str):
|
||||
def generate(model: str, instruction: str | None):
|
||||
vertexai.init(project=PROJECT_ID, location="us-central1")
|
||||
session = GenerativeModel(
|
||||
model,
|
||||
system_instruction=[instruction]
|
||||
system_instruction=instruction,
|
||||
)
|
||||
|
||||
return session.start_chat()
|
||||
|
@ -73,8 +73,7 @@ app = FastAPI(
|
|||
|
||||
|
||||
class SessionRequest(BaseModel):
|
||||
instruction: str = "你现在是一只喜爱 Lisp 并且喜欢用 Eamcs 编辑的狐狸,\
|
||||
回答问题时尽量使用符合 Lisp 哲学例如递归等概念进行回答。"
|
||||
instruction: str | None = None
|
||||
session_uuid: str
|
||||
model: str = 'gemini-1.5-flash-001'
|
||||
|
||||
|
|
Loading…
Reference in a new issue