[BUG] fal_client.result() calls /status endpoint
🐛 Bug Description
The fal_client.result() function in the Python client library calls the /status endpoint instead of a dedicated result endpoint, which contradicts the expected behavior based on the function name and documentation.
🎯 Expected Behavior
fal_client.result()should call a dedicated result endpoint (e.g.,/requests/{id})fal_client.status()should call the status endpoint (/requests/{id}/status)- Clear separation between status checking and result retrieval
🔍 Actual Behavior
Both fal_client.result() and fal_client.status() call the same /status endpoint:
GET https://queue.fal.run/fal-ai/flux-lora-portrait-trainer/requests/{request_id}/status?logs=false
🔄 Steps to Reproduce
- Install fal-client library
- Submit a training request:
training_result = fal_client.submit( "fal-ai/flux-lora-portrait-trainer", arguments={ "images_data_url": zip_url, "trigger_phrase": "test phrase", "steps": 1000 } ) - Monitor network calls when calling:
result = fal_client.result("fal-ai/flux-lora-portrait-trainer", request_id) - Observe that it calls
/statusendpoint instead of a result-specific endpoint
💻 Environment
- Library: fal-client (Python)
- Python Version: 3.x
- Operating System: Window 10
- Library Version: 0.7.0
📊 Impact
- Confusing API design: Function names don't match actual behavior
- Documentation inconsistency: May mislead developers about API structure
- Potential performance issues: Unclear if status endpoint is optimized for result retrieval
- Developer experience: Creates confusion during development and debugging
💡 Suggested Fix
Either:
- Create separate endpoints for status vs result retrieval, OR
- Update documentation to clarify that both functions use the same underlying endpoint
- Consider renaming functions to better reflect actual behavior (e.g.,
get_request_info())
📝 Additional Context
This was discovered during development when monitoring actual HTTP calls made by the client library. The current implementation works functionally but creates confusion about the API design.
From the official documentation, the expectation is that these functions serve different purposes, but the implementation suggests they're essentially the same.
🏷️ Labels
bug documentation api-design python-client
⚡ Priority
Medium - Functional but confusing API design
Hey @iZuminnnn , that's actually inded behavuour - we wait for the result, checking status until it is ready.