Skip to content

Commit

Permalink
Add meta deprecration warning (#910)
Browse files Browse the repository at this point in the history
* adding deprecation warnings
* fixing imports
* fixing 3.9 linting issues
  • Loading branch information
davidsbatista authored Jul 17, 2024
1 parent f03f8bc commit 93eae15
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import json
import logging
import re
import warnings
from typing import Any, Callable, ClassVar, Dict, List, Optional, Type

from botocore.exceptions import ClientError
Expand Down Expand Up @@ -135,6 +136,12 @@ def resolve_secret(secret: Optional[Secret]) -> Optional[str]:
self.stop_words = stop_words or []
self.streaming_callback = streaming_callback

warnings.warn(
"The `meta` output of the AmazonBedrockChatGenerator will change in the next release to be inline with "
"OpenAI `meta`output keys.",
stacklevel=2,
)

def invoke(self, *args, **kwargs):
"""
Invokes the Amazon Bedrock LLM with the given parameters. The parameters are passed to the Amazon Bedrock
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import dataclasses
import json
import warnings
from typing import Any, Callable, ClassVar, Dict, List, Optional, Union

from haystack import component, default_from_dict, default_to_dict, logging
Expand Down Expand Up @@ -114,6 +115,12 @@ def __init__(
self.client = Anthropic(api_key=self.api_key.resolve_value())
self.ignore_tools_thinking_messages = ignore_tools_thinking_messages

warnings.warn(
"The `meta` output of the AnthropicChatGenerator will change in the next release to be inline with "
"OpenAI `meta`output keys.",
stacklevel=2,
)

def _get_telemetry_data(self) -> Dict[str, Any]:
"""
Data that is sent to Posthog for usage analytics.
Expand Down

0 comments on commit 93eae15

Please sign in to comment.