Skip to content

Commit

Permalink
fix: on topic guardrails
Browse files Browse the repository at this point in the history
give the llm a larger context to work with.
be more specific about allowed topics
  • Loading branch information
Erez Sharim committed Aug 7, 2024
1 parent b06b37f commit d78da3e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion app/llm/guardrails/on_topic.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,9 @@ def on_topic_guard():
"greeting",
"access request",
"recommending access",
"information about applications",
"assistant capabilities inquiry",
"information gathering about applications",
"information gathering about access",
]
template = """
Your job is to determine if the user's input is on topic
Expand Down
2 changes: 1 addition & 1 deletion app/llm/nodes.py
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ def _epn(state):

corou = agent.ainvoke(state)
result, ok = asyncio.new_event_loop().run_until_complete(
execute_chat_with_guardrail(runnable=corou, input=state[MEMORY_KEY][-3:])
execute_chat_with_guardrail(runnable=corou, input=state[MEMORY_KEY][-5:])
)

output = result["output"]
Expand Down

0 comments on commit d78da3e

Please sign in to comment.