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

Release langchain azure ai 0.1.2 #50

Merged
merged 3 commits into from
Feb 25, 2025
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
4 changes: 2 additions & 2 deletions libs/azure-ai/pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "langchain-azure-ai"
version = "0.1.1"
version = "0.1.2"
description = "An integration package to support Azure AI Foundry capabilities for model inference in LangChain."
authors = []
license = "MIT"
Expand Down Expand Up @@ -52,7 +52,7 @@ pytest = "^7.3.0"
python-dotenv = "^1.0.1"

[tool.poetry.urls]
"Source Code" = "https://github.com/langchain-ai/langchain-azure/tree/main/libs/azure-inference"
"Source Code" = "https://github.com/langchain-ai/langchain-azure/tree/main/libs/azure-ai"
"Release Notes" = "https://github.com/langchain-ai/langchain-azure/releases"

[tool.mypy]
Expand Down
14 changes: 13 additions & 1 deletion libs/azure-ai/tests/unit_tests/test_chat_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,10 @@
CompletionsFinishReason,
ModelInfo,
)
from langchain_core.messages import AIMessage, HumanMessage, SystemMessage
from langchain_core.messages import AIMessage, HumanMessage, SystemMessage, ToolCall

from langchain_azure_ai.chat_models import AzureAIChatCompletionsModel
from langchain_azure_ai.chat_models.inference import _format_tool_call_for_azure_inference

logger = logging.getLogger(__name__)

Expand Down Expand Up @@ -313,3 +314,14 @@ def test_get_metadata(test_llm: AzureAIChatCompletionsModel, caplog: Any) -> Non
test_llm._model_name != "unknown"
or "does not support model metadata retrieval" in caplog.text
)


def test_format_tool_call_has_function_type() -> None:
tool_call = ToolCall(
id="test-id-123",
name="echo",
args=json.loads('{"message": "Is this a test?"}'),
)
result = _format_tool_call_for_azure_inference(tool_call)
assert result.get("type") == "function"
assert result.get("function", {}).get("name") == "echo"
Loading