on_llm_new_token() — langchain Function Reference
Architecture documentation for the on_llm_new_token() function in test_fake_chat_model.py from the langchain codebase.
Entity Profile
Dependency Diagram
graph TD bfc942da_74ef_84cf_c17e_3eb9a75e609b["on_llm_new_token()"] 5f53f77b_adda_976c_2a8f_56c041df7972["MyCustomAsyncHandler"] bfc942da_74ef_84cf_c17e_3eb9a75e609b -->|defined in| 5f53f77b_adda_976c_2a8f_56c041df7972 af4e520f_33c0_5b8c_7bf9_9b0dd5cb04b9["test_callback_handlers()"] af4e520f_33c0_5b8c_7bf9_9b0dd5cb04b9 -->|calls| bfc942da_74ef_84cf_c17e_3eb9a75e609b style bfc942da_74ef_84cf_c17e_3eb9a75e609b fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
libs/langchain/tests/unit_tests/llms/test_fake_chat_model.py lines 174–184
async def on_llm_new_token(
self,
token: str,
*,
chunk: GenerationChunk | ChatGenerationChunk | None = None,
run_id: UUID,
parent_run_id: UUID | None = None,
tags: list[str] | None = None,
**kwargs: Any,
) -> None:
self.store.append(token)
Domain
Subdomains
Called By
Source
Frequently Asked Questions
What does on_llm_new_token() do?
on_llm_new_token() is a function in the langchain codebase, defined in libs/langchain/tests/unit_tests/llms/test_fake_chat_model.py.
Where is on_llm_new_token() defined?
on_llm_new_token() is defined in libs/langchain/tests/unit_tests/llms/test_fake_chat_model.py at line 174.
What calls on_llm_new_token()?
on_llm_new_token() is called by 1 function(s): test_callback_handlers.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free