Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bug: chatting with an assistant without files fails silently #994

Closed
justinthelaw opened this issue Sep 6, 2024 · 0 comments · Fixed by #995
Closed

bug: chatting with an assistant without files fails silently #994

justinthelaw opened this issue Sep 6, 2024 · 0 comments · Fixed by #995
Labels
possible-bug 🐛 Something may not be working

Comments

@justinthelaw
Copy link
Contributor

justinthelaw commented Sep 6, 2024

Environment

  1. OS and Architecture: Ubuntu 22.04 AMD64
  2. App or Package Name: leapfrogai-api
  3. App or Package Version: main
  4. Kubernetes Distribution: uds-k3d
  5. Kubernetes Version: 1.28.8
  6. Other: N/A

Steps to reproduce

  1. Create an assistant without a file attached in the UI
  2. Chat with the assistant

Expected result

  • Chat message is returned from the run

Actual Result

  • The run fails as the API router's request builder expects a file_ids to not be empty

Visual Proof (screenshots, videos, text, etc)

Traceback (most recent call last):                                                                                                                               
  File "/leapfrogai/.venv/lib/python3.11/site-packages/starlette/responses.py", line 257, in wrap                                                                
    await func()                                                                                                                                                 
  File "/leapfrogai/.venv/lib/python3.11/site-packages/starlette/responses.py", line 246, in stream_response                                                     
    async for chunk in self.body_iterator:                                                                                                                       
  File "/leapfrogai/.venv/lib/python3.11/site-packages/leapfrogai_api/routers/openai/requests/run_create_params_request_base.py", line 380, in stream_generate_message_for_thread                                                                                                                                                      
    chat_messages, file_ids = await self.create_chat_messages(                                                                                                   
                              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^                                                                                                   
  File "/leapfrogai/.venv/lib/python3.11/site-packages/leapfrogai_api/routers/openai/requests/run_create_params_request_base.py", line 286, in create_chat_messages                                                                                                                                                                    
    return chat_messages, list(file_ids)                                                                                                                         
                               ^^^^^^^^                                                                                                                          
UnboundLocalError: cannot access local variable 'file_ids' where it is not associated with a value 

Additional Context

N/A

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
possible-bug 🐛 Something may not be working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant