mirror of
https://github.com/BerriAI/litellm.git
synced 2025-04-26 19:24:27 +00:00
Added tags to additional keys that can be sent to athina
This commit is contained in:
parent
07c0d26e68
commit
c40d45ae09
2 changed files with 5 additions and 1 deletions
|
@ -78,6 +78,7 @@ Following are the allowed fields in metadata, their types, and their description
|
||||||
* `context: Optional[Union[dict, str]]` - This is the context used as information for the prompt. For RAG applications, this is the "retrieved" data. You may log context as a string or as an object (dictionary).
|
* `context: Optional[Union[dict, str]]` - This is the context used as information for the prompt. For RAG applications, this is the "retrieved" data. You may log context as a string or as an object (dictionary).
|
||||||
* `expected_response: Optional[str]` - This is the reference response to compare against for evaluation purposes. This is useful for segmenting inference calls by expected response.
|
* `expected_response: Optional[str]` - This is the reference response to compare against for evaluation purposes. This is useful for segmenting inference calls by expected response.
|
||||||
* `user_query: Optional[str]` - This is the user's query. For conversational applications, this is the user's last message.
|
* `user_query: Optional[str]` - This is the user's query. For conversational applications, this is the user's last message.
|
||||||
|
* `tags: Optional[list]` - This is a list of tags. This is useful for segmenting inference calls by tags.
|
||||||
* `custom_attributes: Optional[dict]` - This is a dictionary of custom attributes. This is useful for additional information about the inference.
|
* `custom_attributes: Optional[dict]` - This is a dictionary of custom attributes. This is useful for additional information about the inference.
|
||||||
|
|
||||||
## Using a self hosted deployment of Athina
|
## Using a self hosted deployment of Athina
|
||||||
|
|
|
@ -23,6 +23,7 @@ class AthinaLogger:
|
||||||
"context",
|
"context",
|
||||||
"expected_response",
|
"expected_response",
|
||||||
"user_query",
|
"user_query",
|
||||||
|
"tags",
|
||||||
"custom_attributes",
|
"custom_attributes",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
@ -78,10 +79,12 @@ class AthinaLogger:
|
||||||
# Add additional metadata keys
|
# Add additional metadata keys
|
||||||
metadata = kwargs.get("litellm_params", {}).get("metadata", {})
|
metadata = kwargs.get("litellm_params", {}).get("metadata", {})
|
||||||
if metadata:
|
if metadata:
|
||||||
|
print("additional_keys", self.additional_keys)
|
||||||
for key in self.additional_keys:
|
for key in self.additional_keys:
|
||||||
|
print("key", key)
|
||||||
if key in metadata:
|
if key in metadata:
|
||||||
|
print("key is being added", key)
|
||||||
data[key] = metadata[key]
|
data[key] = metadata[key]
|
||||||
|
|
||||||
response = litellm.module_level_client.post(
|
response = litellm.module_level_client.post(
|
||||||
self.athina_logging_url,
|
self.athina_logging_url,
|
||||||
headers=self.headers,
|
headers=self.headers,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue