Trying some stuff, including a new model
Some checks failed
Run Python tests (through Pytest) / Test (push) Failing after 23s
Verify Python project can be installed, loaded and have version checked / Test (push) Failing after 21s

This commit is contained in:
Jon Michael Aanes 2025-05-11 02:21:09 +02:00
parent 20688ea3b4
commit 6ea0e48cc3
2 changed files with 10 additions and 4 deletions

View File

@ -20,7 +20,8 @@ from . import tools
cli_history = prompt_toolkit.history.FileHistory('output/cli_history.txt')
#MODEL = "gemma3:27b"
MODEL = "qwen3:latest"
#MODEL = "qwen3:latest"
MODEL = 'hf.co/unsloth/Qwen3-30B-A3B-GGUF:Q4_K_M'
def create_model():
available_tools = tools.get_tools()

View File

@ -7,6 +7,7 @@ from typing import get_type_hints, List, Dict, Any
from collections.abc import Iterator
import logging
import secret_loader
from decimal import Decimal
try:
import pycountry.db
@ -25,14 +26,18 @@ def search(query: str):
def dataclasses_to_json(data):
if pycountry and isinstance(data, pycountry.db.Country):
return data.alpha_3
return data.alpha_2
if isinstance(data, list | tuple):
return [dataclasses_to_json(d) for d in data]
if isinstance(data, dict):
return {k:dataclasses_to_json(v) for k,v in data.items() if v}
if isinstance(data, Decimal):
return float(data)
if dataclasses.is_dataclass(data):
result = {}
for field in dataclasses.fields(data):
result[field.name] = dataclasses_to_json(getattr(data,field.name))
return result
result[field.name] = getattr(data,field.name)
return dataclasses_to_json(result)
return data