Skip to content

Commit

Permalink
chore: update links to chatmessage docs (#8667)
Browse files Browse the repository at this point in the history
  • Loading branch information
anakin87 authored Dec 20, 2024
1 parent 188b2a7 commit 99e7e34
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 9 deletions.
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 @@ -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
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 @@ -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):
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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"])
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

0 comments on commit 99e7e34

Please sign in to comment.