Skip to content

Commit

Permalink
chore: Update chat flow configuration and requirements
Browse files Browse the repository at this point in the history
  • Loading branch information
sichoi42 committed Jul 4, 2024
1 parent 936b145 commit b62a758
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 12 deletions.
15 changes: 4 additions & 11 deletions flows/interview_chat/chat/flow.dag.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,10 @@ inputs:
default: 5
description: 최대 질문 수
is_chat_input: false

outputs:
question:
type: string
reference: ${flow_output.output}

nodes:
- name: ask_questions
type: llm
Expand All @@ -53,23 +51,21 @@ nodes:
path: ask_questions.jinja2
inputs:
model: gpt-3.5-turbo-16k
temperature: 0.2
temperature: 0.4
top_p: 1
response_format:
type: text
question: ${inputs.question}
user_name: ${inputs.user_name}
borned_at: ${inputs.borned_at}
chat_history: ${inputs.chat_history}
gender: ${inputs.gender}
has_children: ${inputs.has_children}
limit: ${inputs.question_limit}
question: ${inputs.question}
user_name: ${inputs.user_name}
chat_history: ${inputs.chat_history}
provider: OpenAI
connection: life-bookshelf
api: chat
module: promptflow.tools.openai
use_variants: false

- name: check_question_limit
type: python
source:
Expand All @@ -78,7 +74,6 @@ nodes:
inputs:
chat_history: ${inputs.chat_history}
limit: ${inputs.question_limit}

- name: flow_output
type: python
source:
Expand All @@ -87,5 +82,3 @@ nodes:
inputs:
stop_or_continue: ${check_question_limit.output}
question: ${ask_questions.output}

node_variants: {}
8 changes: 8 additions & 0 deletions flows/interview_chat/chat/flow_output.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
from promptflow.core import tool

@tool
def flow_output(stop_or_continue: str, question: str) -> str:
if stop_or_continue == '[STOP]':
return "[STOP]"
else:
return question
3 changes: 2 additions & 1 deletion flows/interview_chat/chat/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
promptflow
promptflow[azure]
promptflow-tools
python-dotenv

0 comments on commit b62a758

Please sign in to comment.