v1.2.2
Co-Authored-By: Quentin Torroba <quentin.torroba@mistral.ai> Co-Authored-By: Michel Thomazo <michel.thomazo@mistral.ai>
This commit is contained in:
parent
402e898f39
commit
2e1e15120d
32 changed files with 391 additions and 549 deletions
|
|
@ -426,7 +426,7 @@ class TestSessionManagement:
|
|||
class TestSessionUpdates:
|
||||
@pytest.mark.asyncio
|
||||
async def test_agent_message_chunk_structure(self, vibe_home_dir: Path) -> None:
|
||||
mock_env = get_mocking_env([mock_llm_chunk(content="Hi") for _ in range(2)])
|
||||
mock_env = get_mocking_env([mock_llm_chunk(content="Hi")])
|
||||
async for process in get_acp_agent_process(
|
||||
mock_env=mock_env, vibe_home=vibe_home_dir
|
||||
):
|
||||
|
|
@ -465,7 +465,6 @@ class TestSessionUpdates:
|
|||
@pytest.mark.asyncio
|
||||
async def test_tool_call_update_structure(self, vibe_home_dir: Path) -> None:
|
||||
mock_env = get_mocking_env([
|
||||
mock_llm_chunk(content="Hey"),
|
||||
mock_llm_chunk(
|
||||
tool_calls=[
|
||||
ToolCall(
|
||||
|
|
@ -475,14 +474,9 @@ class TestSessionUpdates:
|
|||
type="function",
|
||||
index=0,
|
||||
)
|
||||
],
|
||||
name="bash",
|
||||
finish_reason="tool_calls",
|
||||
),
|
||||
mock_llm_chunk(
|
||||
content="The files containing the pattern 'auth' are ...",
|
||||
finish_reason="stop",
|
||||
]
|
||||
),
|
||||
mock_llm_chunk(content="The files containing the pattern 'auth' are ..."),
|
||||
])
|
||||
async for process in get_acp_agent_process(
|
||||
mock_env=mock_env, vibe_home=vibe_home_dir
|
||||
|
|
@ -567,7 +561,6 @@ class TestToolCallStructure:
|
|||
self, vibe_home_grep_ask: Path
|
||||
) -> None:
|
||||
custom_results = [
|
||||
mock_llm_chunk(content="Hey"),
|
||||
mock_llm_chunk(
|
||||
tool_calls=[
|
||||
ToolCall(
|
||||
|
|
@ -578,10 +571,8 @@ class TestToolCallStructure:
|
|||
type="function",
|
||||
index=0,
|
||||
)
|
||||
],
|
||||
name="grep",
|
||||
finish_reason="tool_calls",
|
||||
),
|
||||
]
|
||||
)
|
||||
]
|
||||
mock_env = get_mocking_env(custom_results)
|
||||
async for process in get_acp_agent_process(
|
||||
|
|
@ -628,7 +619,6 @@ class TestToolCallStructure:
|
|||
self, vibe_home_grep_ask: Path
|
||||
) -> None:
|
||||
custom_results = [
|
||||
mock_llm_chunk(content="Hey"),
|
||||
mock_llm_chunk(
|
||||
tool_calls=[
|
||||
ToolCall(
|
||||
|
|
@ -639,13 +629,10 @@ class TestToolCallStructure:
|
|||
type="function",
|
||||
index=0,
|
||||
)
|
||||
],
|
||||
name="grep",
|
||||
finish_reason="tool_calls",
|
||||
),
|
||||
mock_llm_chunk(
|
||||
content="The search for 'auth' has been completed", finish_reason="stop"
|
||||
]
|
||||
),
|
||||
mock_llm_chunk(content="The search for 'auth' has been completed"),
|
||||
mock_llm_chunk(content="The file test.txt has been created"),
|
||||
]
|
||||
mock_env = get_mocking_env(custom_results)
|
||||
async for process in get_acp_agent_process(
|
||||
|
|
@ -692,7 +679,6 @@ class TestToolCallStructure:
|
|||
self, vibe_home_grep_ask: Path
|
||||
) -> None:
|
||||
custom_results = [
|
||||
mock_llm_chunk(content="Hey"),
|
||||
mock_llm_chunk(
|
||||
tool_calls=[
|
||||
ToolCall(
|
||||
|
|
@ -703,14 +689,11 @@ class TestToolCallStructure:
|
|||
type="function",
|
||||
index=0,
|
||||
)
|
||||
],
|
||||
name="grep",
|
||||
finish_reason="tool_calls",
|
||||
]
|
||||
),
|
||||
mock_llm_chunk(
|
||||
content="The search for 'auth' has not been performed, "
|
||||
"because you rejected the permission request",
|
||||
finish_reason="stop",
|
||||
"because you rejected the permission request"
|
||||
),
|
||||
]
|
||||
mock_env = get_mocking_env(custom_results)
|
||||
|
|
@ -759,7 +742,6 @@ class TestToolCallStructure:
|
|||
self, vibe_home_grep_ask: Path
|
||||
) -> None:
|
||||
custom_results = [
|
||||
mock_llm_chunk(content="Hey"),
|
||||
mock_llm_chunk(
|
||||
tool_calls=[
|
||||
ToolCall(
|
||||
|
|
@ -770,13 +752,10 @@ class TestToolCallStructure:
|
|||
type="function",
|
||||
index=0,
|
||||
)
|
||||
],
|
||||
name="grep",
|
||||
finish_reason="tool_calls",
|
||||
),
|
||||
mock_llm_chunk(
|
||||
content="The search for 'auth' has been completed", finish_reason="stop"
|
||||
]
|
||||
),
|
||||
mock_llm_chunk(content="The search for 'auth' has been completed"),
|
||||
mock_llm_chunk(content="The command sleep 3 has been run"),
|
||||
]
|
||||
mock_env = get_mocking_env(custom_results)
|
||||
async for process in get_acp_agent_process(
|
||||
|
|
@ -820,7 +799,6 @@ class TestToolCallStructure:
|
|||
self, vibe_home_grep_ask: Path
|
||||
) -> None:
|
||||
custom_results = [
|
||||
mock_llm_chunk(content="Hey"),
|
||||
mock_llm_chunk(
|
||||
tool_calls=[
|
||||
ToolCall(
|
||||
|
|
@ -831,14 +809,11 @@ class TestToolCallStructure:
|
|||
type="function",
|
||||
index=0,
|
||||
)
|
||||
],
|
||||
name="grep",
|
||||
finish_reason="tool_calls",
|
||||
]
|
||||
),
|
||||
mock_llm_chunk(
|
||||
content="The search for 'auth' has failed "
|
||||
"because the path does not exist",
|
||||
finish_reason="stop",
|
||||
"because the path does not exist"
|
||||
),
|
||||
]
|
||||
mock_env = get_mocking_env(custom_results)
|
||||
|
|
@ -894,7 +869,6 @@ class TestCancellationStructure:
|
|||
self, vibe_home_dir: Path
|
||||
) -> None:
|
||||
custom_results = [
|
||||
mock_llm_chunk(content="Hey"),
|
||||
mock_llm_chunk(
|
||||
tool_calls=[
|
||||
ToolCall(
|
||||
|
|
@ -906,14 +880,11 @@ class TestCancellationStructure:
|
|||
type="function",
|
||||
index=0,
|
||||
)
|
||||
],
|
||||
name="write_file",
|
||||
finish_reason="tool_calls",
|
||||
]
|
||||
),
|
||||
mock_llm_chunk(
|
||||
content="The file test.txt has not been created, "
|
||||
"because you cancelled the permission request",
|
||||
finish_reason="stop",
|
||||
"because you cancelled the permission request"
|
||||
),
|
||||
]
|
||||
mock_env = get_mocking_env(custom_results)
|
||||
|
|
|
|||
|
|
@ -22,13 +22,10 @@ from vibe.core.types import LLMChunk, LLMMessage, LLMUsage, Role
|
|||
@pytest.fixture
|
||||
def backend() -> FakeBackend:
|
||||
backend = FakeBackend(
|
||||
results=[
|
||||
LLMChunk(
|
||||
message=LLMMessage(role=Role.assistant, content="Hi"),
|
||||
finish_reason="end_turn",
|
||||
usage=LLMUsage(prompt_tokens=1, completion_tokens=1),
|
||||
)
|
||||
]
|
||||
LLMChunk(
|
||||
message=LLMMessage(role=Role.assistant, content="Hi"),
|
||||
usage=LLMUsage(prompt_tokens=1, completion_tokens=1),
|
||||
)
|
||||
)
|
||||
return backend
|
||||
|
||||
|
|
|
|||
|
|
@ -41,7 +41,7 @@ class TestACPInitialize:
|
|||
),
|
||||
)
|
||||
assert response.agentInfo == Implementation(
|
||||
name="@mistralai/mistral-vibe", title="Mistral Vibe", version="1.2.1"
|
||||
name="@mistralai/mistral-vibe", title="Mistral Vibe", version="1.2.2"
|
||||
)
|
||||
|
||||
assert response.authMethods == []
|
||||
|
|
@ -63,7 +63,7 @@ class TestACPInitialize:
|
|||
),
|
||||
)
|
||||
assert response.agentInfo == Implementation(
|
||||
name="@mistralai/mistral-vibe", title="Mistral Vibe", version="1.2.1"
|
||||
name="@mistralai/mistral-vibe", title="Mistral Vibe", version="1.2.2"
|
||||
)
|
||||
|
||||
assert response.authMethods is not None
|
||||
|
|
|
|||
|
|
@ -116,9 +116,9 @@ class TestMultiSessionCore:
|
|||
)
|
||||
session2 = acp_agent.sessions[session2_response.sessionId]
|
||||
|
||||
backend._chunks = [
|
||||
mock_llm_chunk(content="Response 1", finish_reason="stop"),
|
||||
mock_llm_chunk(content="Response 2", finish_reason="stop"),
|
||||
backend._streams = [
|
||||
[mock_llm_chunk(content="Response 1")],
|
||||
[mock_llm_chunk(content="Response 2")],
|
||||
]
|
||||
|
||||
async def run_session1():
|
||||
|
|
|
|||
|
|
@ -18,13 +18,10 @@ from vibe.core.types import LLMChunk, LLMMessage, LLMUsage, Role
|
|||
@pytest.fixture
|
||||
def backend() -> FakeBackend:
|
||||
backend = FakeBackend(
|
||||
results=[
|
||||
LLMChunk(
|
||||
message=LLMMessage(role=Role.assistant, content="Hi"),
|
||||
finish_reason="end_turn",
|
||||
usage=LLMUsage(prompt_tokens=1, completion_tokens=1),
|
||||
)
|
||||
]
|
||||
LLMChunk(
|
||||
message=LLMMessage(role=Role.assistant, content="Hi"),
|
||||
usage=LLMUsage(prompt_tokens=1, completion_tokens=1),
|
||||
)
|
||||
)
|
||||
return backend
|
||||
|
||||
|
|
|
|||
|
|
@ -17,13 +17,10 @@ from vibe.core.types import LLMChunk, LLMMessage, LLMUsage, Role
|
|||
@pytest.fixture
|
||||
def backend() -> FakeBackend:
|
||||
backend = FakeBackend(
|
||||
results=[
|
||||
LLMChunk(
|
||||
message=LLMMessage(role=Role.assistant, content="Hi"),
|
||||
finish_reason="end_turn",
|
||||
usage=LLMUsage(prompt_tokens=1, completion_tokens=1),
|
||||
)
|
||||
]
|
||||
LLMChunk(
|
||||
message=LLMMessage(role=Role.assistant, content="Hi"),
|
||||
usage=LLMUsage(prompt_tokens=1, completion_tokens=1),
|
||||
)
|
||||
)
|
||||
return backend
|
||||
|
||||
|
|
|
|||
|
|
@ -17,13 +17,10 @@ from vibe.core.types import LLMChunk, LLMMessage, LLMUsage, Role
|
|||
@pytest.fixture
|
||||
def backend() -> FakeBackend:
|
||||
backend = FakeBackend(
|
||||
results=[
|
||||
LLMChunk(
|
||||
message=LLMMessage(role=Role.assistant, content="Hi"),
|
||||
finish_reason="end_turn",
|
||||
usage=LLMUsage(prompt_tokens=1, completion_tokens=1),
|
||||
)
|
||||
]
|
||||
LLMChunk(
|
||||
message=LLMMessage(role=Role.assistant, content="Hi"),
|
||||
usage=LLMUsage(prompt_tokens=1, completion_tokens=1),
|
||||
)
|
||||
)
|
||||
return backend
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue