Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: update links to ChatMessage docs #8667

Merged
merged 1 commit into from
Dec 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion haystack/components/generators/chat/azure.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion haystack/components/generators/chat/hugging_face_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion haystack/components/generators/chat/openai.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,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
Expand Down
6 changes: 3 additions & 3 deletions haystack/dataclasses/chat_message.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,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):
Expand Down Expand Up @@ -142,7 +142,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)
Expand Down Expand Up @@ -357,7 +357,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"])
Expand Down
6 changes: 3 additions & 3 deletions releasenotes/notes/new-chatmessage-7f47d5bdeb6ad6f5.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Loading