Skip to content

Commit

Permalink
Update ContextCallbackHandler Docstring & metadata key (#10732)
Browse files Browse the repository at this point in the history
- **Description:** Updating URL in Context Callback Docstrings and
update metadata key Context CallbackHandler uses to send model names.
- **Issue:** The URL in ContextCallbackHandler is out of date. Model
data being sent to Context should be under the "model" key and not
"llm_model". This allows Context to do more sophisticated analysis.
  - **Dependencies:** None

Tagging @agamble.
  • Loading branch information
BarberAlec authored Sep 19, 2023
1 parent 54763a6 commit c898a4d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions libs/langchain/langchain/callbacks/context_callback.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ def import_context() -> Any:
class ContextCallbackHandler(BaseCallbackHandler):
"""Callback Handler that records transcripts to the Context service.
(https://getcontext.ai).
(https://context.ai).
Keyword Args:
token (optional): The token with which to authenticate requests to Context.
Expand Down Expand Up @@ -122,7 +122,7 @@ def on_chat_model_start(
"""Run when the chat model is started."""
llm_model = kwargs.get("invocation_params", {}).get("model", None)
if llm_model is not None:
self.metadata["llm_model"] = llm_model
self.metadata["model"] = llm_model

if len(messages) == 0:
return
Expand Down

0 comments on commit c898a4d

Please sign in to comment.