versioning: 0.0.6, ux: move buttons, feat: add cloud providers, feat: increese tool call limit
Build Release EXE / build-windows-exe (release) Successful in 51s
Build Release EXE / build-windows-exe (release) Successful in 51s
This commit is contained in:
@@ -64,6 +64,19 @@ class TitleAgent(OllamaAgent):
|
||||
return {"message": {"role": "assistant", "content": "Done"}}
|
||||
|
||||
|
||||
class ImageCaptureAgent(OllamaAgent):
|
||||
def __init__(self, memory):
|
||||
super().__init__("http://127.0.0.1:1", "missing-model", EmptyTools(), memory=memory)
|
||||
self.last_messages = None
|
||||
|
||||
async def ensure_available(self):
|
||||
return None
|
||||
|
||||
async def _chat_once(self, query="", messages=None, **kwargs):
|
||||
self.last_messages = messages
|
||||
return {"message": {"role": "assistant", "content": "Seen"}}
|
||||
|
||||
|
||||
class SlowToolTools(EmptyTools):
|
||||
schemas = [
|
||||
{
|
||||
@@ -229,6 +242,23 @@ async def test_first_chat_message_generates_thread_title(tmp_path):
|
||||
assert memory.get_thread(thread["id"])["title"] == "UEX Market Check"
|
||||
|
||||
|
||||
@pytest.mark.asyncio
|
||||
async def test_chat_includes_pasted_images_and_memory_note(tmp_path):
|
||||
memory = MemoryStore(str(tmp_path / "memory.sqlite3"))
|
||||
agent = ImageCaptureAgent(memory)
|
||||
|
||||
result = await agent.chat(
|
||||
"",
|
||||
images=[{"name": "listing.png", "content_type": "image/png", "image_data": "ZmFrZS1pbWFnZQ=="}],
|
||||
)
|
||||
|
||||
assert result["message"] == "Seen"
|
||||
user_message = next(message for message in reversed(agent.last_messages) if message.get("role") == "user")
|
||||
assert user_message["images"] == ["ZmFrZS1pbWFnZQ=="]
|
||||
assert user_message["content"] == "Please analyze the attached image."
|
||||
assert "[Attached 1 pasted image]" in memory.recent_conversation()[-2]["content"]
|
||||
|
||||
|
||||
@pytest.mark.asyncio
|
||||
async def test_chat_events_returns_fallback_after_slow_tool_and_empty_final_response(tmp_path):
|
||||
memory = MemoryStore(str(tmp_path / "memory.sqlite3"))
|
||||
|
||||
Reference in New Issue
Block a user