Update ContextCallbackHandler Docstring & metadata key (#10732)

- **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.
pull/10677/head^2
BarberAlec 11 months ago committed by GitHub
parent 54763a61f8
commit c898a4d7ba
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -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.
@ -122,7 +122,7 @@ class ContextCallbackHandler(BaseCallbackHandler):
"""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

Loading…
Cancel
Save