Skip to content

Commit

Permalink
fix: updated chatbot to take dag as dict
Browse files Browse the repository at this point in the history
  • Loading branch information
chanh-1 committed Apr 8, 2023
1 parent 97226b2 commit 038b7a7
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions server/api/chatbot.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,14 @@

class ChatBotModel(BaseModel):
name: str
created_by: str
dag: str
dag: dict

@chatbot_router.post("/", status_code=200)
def create_chatbot(inputs: ChatBotModel, token: Annotated[str, Header()], db: Session = Depends(database.db_session)):
username = get_user_from_jwt(token)
verify_user(username)
try:
chatbot = ChatBot(name=inputs.name, created_by=inputs.created_by, dag=inputs.dag)
chatbot = ChatBot(name=inputs.name, created_by=username, dag=inputs.dag)
db.add(chatbot)
db.commit()
response = {"msg": "success"}
Expand Down

0 comments on commit 038b7a7

Please sign in to comment.