Skip to content

Commit

Permalink
Reduce logs (#1351)
Browse files Browse the repository at this point in the history
  • Loading branch information
beastoin authored Nov 20, 2024
2 parents 8adf1d2 + 75f1db9 commit 7efb5ee
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion backend/modal/speech_profile_modal.py
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ def endpoint(uid: str, audio_file: UploadFile = File(...), segments: str = Form(
people = []
try:
result = classify_segments(audio_file.filename, profile_path, people, transcript_segments)
print(result)
# print(result)
return result
except:
return default
Expand Down
2 changes: 1 addition & 1 deletion backend/routers/custom_auth.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ def sign_in(credentials: UserCredentials):
}
response = requests.post(url, json=payload)
if response.status_code != 200:
print(response.json())
# print(response.json())
raise HTTPException(status_code=401, detail="Invalid credentials")

firebase_token = response.json().get("idToken")
Expand Down
6 changes: 3 additions & 3 deletions backend/utils/llm.py
Original file line number Diff line number Diff line change
Expand Up @@ -374,7 +374,7 @@ def answer_simple_message(uid: str, messages: List[Message], plugin: Optional[Pl
Answer:
""".replace(' ', '').strip()
print(prompt)
# print(prompt)
return llm_mini.invoke(prompt).content


Expand Down Expand Up @@ -778,7 +778,7 @@ def select_structured_filters(question: str, filters_available: dict) -> dict:
with_parser = llm_mini.with_structured_output(FiltersToUse)
try:
response: FiltersToUse = with_parser.invoke(prompt)
print('select_structured_filters:', response.dict())
# print('select_structured_filters:', response.dict())
response.topics = [t for t in response.topics if t in filters_available['topics']]
response.people = [p for p in response.people if p in filters_available['people']]
response.entities = [e for e in response.entities if e in filters_available['entities']]
Expand Down Expand Up @@ -879,6 +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)
# print(prompt)

return llm_mini.invoke(prompt).content
10 changes: 5 additions & 5 deletions backend/utils/plugins.py
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ def _single(plugin: App):
try:
response = requests.post(url, json=memory_dict, timeout=30, ) # TODO: failing?
if response.status_code != 200:
print('Plugin integration failed', plugin.id, 'result:', response.content)
print('Plugin integration failed', plugin.id, 'status:', response.status_code, 'result:', response.text[:100])
return

record_plugin_usage(uid, plugin.id, UsageHistoryType.memory_created_external_integration,
Expand Down Expand Up @@ -293,7 +293,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 Expand Up @@ -333,7 +333,7 @@ def _single(plugin: App):
try:
response = requests.post(url, json={"session_id": uid, "segments": segments}, timeout=30)
if response.status_code != 200:
print('trigger_realtime_integrations', plugin.id, 'result:', response.content)
print('trigger_realtime_integrations', plugin.id, 'status: ', response.status_code, 'results:', response.text[:100])
return

response_data = response.json()
Expand All @@ -342,14 +342,14 @@ def _single(plugin: App):

# message
message = response_data.get('message', '')
print('Plugin', plugin.id, 'response message:', message)
# print('Plugin', plugin.id, 'response message:', message)
if message and len(message) > 5:
send_plugin_notification(token, plugin.name, plugin.id, message)
results[plugin.id] = message

# proactive_notification
noti = response_data.get('notification', None)
print('Plugin', plugin.id, 'response notification:', noti)
# print('Plugin', plugin.id, 'response notification:', noti)
if plugin.has_capability("proactive_notification"):
message = _process_proactive_notification(uid, token, plugin, noti)
if message:
Expand Down
2 changes: 1 addition & 1 deletion backend/utils/stt/pre_recorded.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ def fal_whisperx(
},
)
result = handler.get()
print(result)
# print(result)
words = result.get('chunks', [])
if not words:
raise Exception('No chunks found')
Expand Down

0 comments on commit 7efb5ee

Please sign in to comment.