Skip to content

Commit

Permalink
Fix outdated generation context doc
Browse files Browse the repository at this point in the history
  • Loading branch information
Trojaner committed May 18, 2024
1 parent bf0c74f commit 088d413
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions context.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,22 +13,20 @@ class GenerationContext(object):
state: dict | None = None


# Create a thread-local state for multi-threading support in case
# multiple sessions run concurrently at the same time.
_current_context: GenerationContext | None = None


def get_current_context() -> GenerationContext | None:
"""
Gets the current generation context (thread-safe).
Gets the current generation context. Must be called inside a generation request.
"""

return _current_context


def set_current_context(context: GenerationContext | None) -> None:
"""
Sets the current generation context (thread-safe).
Sets the current generation context. Must be called inside a generation request.
"""

global _current_context
Expand Down

0 comments on commit 088d413

Please sign in to comment.