File tree Expand file tree Collapse file tree 2 files changed +9
-4
lines changed Expand file tree Collapse file tree 2 files changed +9
-4
lines changed Original file line number Diff line number Diff line change @@ -73,9 +73,7 @@ def _parse_react_tool_calls(
7373 invalid_tool_calls : list [InvalidToolCall ] = []
7474
7575 bracket_pattern = r"Action:\s*(?P<name>[\w.-]+)\[(?P<input>[^\]]+)\]"
76- separate_pattern = (
77- r"Action:\s*(?P<name>[^\n]+)\nAction Input:\s*(?P<input>[^\n]+)"
78- )
76+ separate_pattern = r"Action:\s*(?P<name>[^\n]+)\nAction Input:\s*(?P<input>[^\n]+)"
7977
8078 matches = list (re .finditer (bracket_pattern , text ))
8179 if not matches :
Original file line number Diff line number Diff line change 11"""Test MLX Chat wrapper."""
22
33from importlib import import_module
4+ from typing import Any
45
56import pytest
67from langchain_core .messages import HumanMessage
78
89from langchain_community .chat_models .mlx import ChatMLX
10+ from langchain_community .llms .mlx_pipeline import MLXPipeline
911
1012
1113class _FakeTokenizer :
@@ -24,7 +26,12 @@ def apply_chat_template(
2426 return "prompt"
2527
2628
27- class _FakeLLM :
29+ class _FakeLLM (MLXPipeline ):
30+ model_id : str = "fake-model"
31+ model : Any = None
32+ tokenizer : Any = None
33+ pipeline_kwargs : dict = {}
34+
2835 def __init__ (self ) -> None :
2936 self .tokenizer = _FakeTokenizer ()
3037
You can’t perform that action at this time.
0 commit comments