• Stefy Lanza (nextime / spora )'s avatar
    Fix effective_context variable scope and calculate total tokens for streaming responses · 8f07c660
    Stefy Lanza (nextime / spora ) authored
    - Pass effective_context as parameter to stream_generator functions
    - Update _create_streaming_response signature to accept effective_context
    - Update all calls to _create_streaming_response to pass effective_context
    - Track accumulated response text for token counting in streaming
    - Calculate completion tokens for Google responses (since Google doesn't provide them)
    - Calculate completion tokens for non-Google providers when they don't provide token counts
    - Include prompt_tokens, completion_tokens, total_tokens, and effective_context in final chunk
    - Fixes 'name effective_context is not defined' error in streaming responses
    - Fixes issue where streaming responses had null token counts
    8f07c660
Name
Last commit
Last update
aisbf Loading commit data...
config Loading commit data...
.gitignore Loading commit data...
.providers.json.swp Loading commit data...
AI.PROMPT Loading commit data...
CHANGELOG.md Loading commit data...
DEBUG_GUIDE.md Loading commit data...
DOCUMENTATION.md Loading commit data...
LICENSE.txt Loading commit data...
MANIFEST.in Loading commit data...
PYPI.md Loading commit data...
README.md Loading commit data...
aisbf.sh Loading commit data...
build.sh Loading commit data...
clean.sh Loading commit data...
cli.py Loading commit data...
main.py Loading commit data...
pyproject.toml Loading commit data...
requirements.txt Loading commit data...
setup.py Loading commit data...
start_proxy.sh Loading commit data...
test_google.sh Loading commit data...
test_proxy.sh Loading commit data...