diff --git a/haystack/components/generators/chat/azure.py b/haystack/components/generators/chat/azure.py index ae7787d637..3a27078e57 100644 --- a/haystack/components/generators/chat/azure.py +++ b/haystack/components/generators/chat/azure.py @@ -22,7 +22,7 @@ class AzureOpenAIChatGenerator(OpenAIChatGenerator): Generates text using OpenAI's models on Azure. It works with the gpt-4 and gpt-3.5-turbo - type models and supports streaming responses - from OpenAI API. It uses [ChatMessage](https://docs.haystack.deepset.ai/docs/data-classes#chatmessage) + from OpenAI API. It uses [ChatMessage](https://docs.haystack.deepset.ai/docs/chatmessage) format in input and output. You can customize how the text is generated by passing parameters to the diff --git a/haystack/components/generators/chat/hugging_face_api.py b/haystack/components/generators/chat/hugging_face_api.py index 9a0cc75906..06aa674f73 100644 --- a/haystack/components/generators/chat/hugging_face_api.py +++ b/haystack/components/generators/chat/hugging_face_api.py @@ -29,7 +29,7 @@ class HuggingFaceAPIChatGenerator: """ Completes chats using Hugging Face APIs. - HuggingFaceAPIChatGenerator uses the [ChatMessage](https://docs.haystack.deepset.ai/docs/data-classes#chatmessage) + HuggingFaceAPIChatGenerator uses the [ChatMessage](https://docs.haystack.deepset.ai/docs/chatmessage) format for input and output. Use it to generate text with Hugging Face APIs: - [Free Serverless Inference API](https://huggingface.co/inference-api) - [Paid Inference Endpoints](https://huggingface.co/inference-endpoints) diff --git a/haystack/components/generators/chat/openai.py b/haystack/components/generators/chat/openai.py index 2662014f9a..932fc3345b 100644 --- a/haystack/components/generators/chat/openai.py +++ b/haystack/components/generators/chat/openai.py @@ -28,7 +28,7 @@ class OpenAIChatGenerator: Completes chats using OpenAI's large language models (LLMs). It works with the gpt-4 and gpt-3.5-turbo models and supports streaming responses - from OpenAI API. It uses [ChatMessage](https://docs.haystack.deepset.ai/docs/data-classes#chatmessage) + from OpenAI API. It uses [ChatMessage](https://docs.haystack.deepset.ai/docs/chatmessage) format in input and output. You can customize how the text is generated by passing parameters to the diff --git a/haystack/dataclasses/chat_message.py b/haystack/dataclasses/chat_message.py index e4d656b15e..0a028f101e 100644 --- a/haystack/dataclasses/chat_message.py +++ b/haystack/dataclasses/chat_message.py @@ -109,7 +109,7 @@ def __new__(cls, *args, **kwargs): general_msg = ( "Use the `from_assistant`, `from_user`, `from_system`, and `from_tool` class methods to create a " "ChatMessage. For more information about the new API and how to migrate, see the documentation:" - " https://docs.haystack.deepset.ai/docs/data-classes#chatmessage" + " https://docs.haystack.deepset.ai/docs/chatmessage" ) if any(param in kwargs for param in LEGACY_INIT_PARAMETERS): @@ -143,7 +143,7 @@ def __getattribute__(self, name): "The `content` attribute of `ChatMessage` has been removed. " "Use the `text` property to access the textual value. " "For more information about the new API and how to migrate, see the documentation: " - "https://docs.haystack.deepset.ai/docs/data-classes#chatmessage" + "https://docs.haystack.deepset.ai/docs/chatmessage" ) raise AttributeError(msg) return object.__getattribute__(self, name) @@ -358,7 +358,7 @@ def from_dict(cls, data: Dict[str, Any]) -> "ChatMessage": raise TypeError( "The `role`, `content`, `meta`, and `name` init parameters of `ChatMessage` have been removed. " "For more information about the new API and how to migrate, see the documentation: " - "https://docs.haystack.deepset.ai/docs/data-classes#chatmessage" + "https://docs.haystack.deepset.ai/docs/chatmessage" ) data["_role"] = ChatRole(data["_role"]) diff --git a/releasenotes/notes/new-chatmessage-7f47d5bdeb6ad6f5.yaml b/releasenotes/notes/new-chatmessage-7f47d5bdeb6ad6f5.yaml index b9e590e590..f798a4c1d8 100644 --- a/releasenotes/notes/new-chatmessage-7f47d5bdeb6ad6f5.yaml +++ b/releasenotes/notes/new-chatmessage-7f47d5bdeb6ad6f5.yaml @@ -3,14 +3,14 @@ highlights: > We are introducing a refactored ChatMessage dataclass. It is more flexible, future-proof, and compatible with different types of content: text, tool calls, tool calls results. For information about the new API and how to migrate, see the documentation: - https://docs.haystack.deepset.ai/docs/data-classes#chatmessage + https://docs.haystack.deepset.ai/docs/chatmessage upgrade: - | The refactoring of the ChatMessage dataclass includes some breaking changes, involving ChatMessage creation and accessing attributes. If you have a Pipeline containing a ChatPromptBuilder, serialized using Haystack<2.9.0, deserialization may break. For detailed information about the changes and how to migrate, see the documentation: - https://docs.haystack.deepset.ai/docs/data-classes#chatmessage + https://docs.haystack.deepset.ai/docs/chatmessage features: - | Changed the ChatMessage dataclass to support different types of content, including tool calls, and tool call @@ -20,4 +20,4 @@ deprecations: The function role and ChatMessage.from_function class method have been deprecated and will be removed in Haystack 2.10.0. ChatMessage.from_function also attempts to produce a valid tool message. For more information, see the documentation: - https://docs.haystack.deepset.ai/docs/data-classes#chatmessage + https://docs.haystack.deepset.ai/docs/chatmessage