Skip to content

Commit

Permalink
Fix metor01's context param
Browse files Browse the repository at this point in the history
  • Loading branch information
beastoin committed Nov 18, 2024
1 parent 561edc8 commit 1b80a7f
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions backend/utils/llm.py
Original file line number Diff line number Diff line change
Expand Up @@ -879,5 +879,6 @@ def get_proactive_message(uid: str, plugin_prompt: str, params: [str], context:
prompt = prompt.replace("{{user_context}}", context if context else "")
continue
prompt = prompt.replace(' ', '').strip()
#print(prompt)

return llm_mini.invoke(prompt).content
2 changes: 1 addition & 1 deletion backend/utils/plugins.py
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,7 @@ def _process_proactive_notification(uid: str, token: str, plugin: App, data):
if len(memories) > 0:
context = Memory.memories_to_string(memories, True)

print(f'_process_proactive_notification context {context[100] if context else "empty"}')
print(f'_process_proactive_notification context {context[:100] if context else "empty"}')

# retrive message
message = get_proactive_message(uid, prompt, filter_scopes, context)
Expand Down
2 changes: 1 addition & 1 deletion plugins/example/basic/mentor.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
# ************ Basic Proactive Notification Plugin ************
# *******************************************************

@router.post('/mentor', tags=['mentor', 'basic', 'realtime', 'proactive_notification'], response_model=ProactiveNotificationEndpointResponse)
@router.post('/mentor', tags=['mentor', 'basic', 'realtime', 'proactive_notification'], response_model=ProactiveNotificationEndpointResponse, response_model_exclude_none=True)
def mentoring(data: RealtimePluginRequest):
def normalize(text):
return re.sub(r' +', ' ',re.sub(r'[,?.!]', ' ', text)).lower().strip()
Expand Down

0 comments on commit 1b80a7f

Please sign in to comment.