Compare commits

...

2 Commits

Author SHA1 Message Date
7e6b0ccfac fix the services cogs issue 2025-05-26 18:14:43 +03:00
feb9204c16 update 2025-05-26 17:10:51 +03:00
3 changed files with 26 additions and 26 deletions

View File

@ -22,8 +22,8 @@ Add the following to your Django settings.py file:
```python ```python
# Ollama and LangChain settings # Ollama and LangChain settings
OLLAMA_BASE_URL = "http://localhost:11434" # Default Ollama API URL OLLAMA_BASE_URL = "http://10.10.1.132:11434" # Default Ollama API URL
OLLAMA_MODEL = "jais:13b" # Or your preferred model OLLAMA_MODEL = "qwen3:6b" # Or your preferred model
OLLAMA_TIMEOUT = 120 # Seconds OLLAMA_TIMEOUT = 120 # Seconds
``` ```
@ -46,8 +46,8 @@ def get_ollama_llm():
""" """
try: try:
# Get settings from Django settings or use defaults # Get settings from Django settings or use defaults
base_url = getattr(settings, 'OLLAMA_BASE_URL', 'http://localhost:11434') base_url = getattr(settings, 'OLLAMA_BASE_URL', 'http://10.10.1.132:11434')
model = getattr(settings, 'OLLAMA_MODEL', 'jais:13b') model = getattr(settings, 'OLLAMA_MODEL', 'qwen3:8b')
timeout = getattr(settings, 'OLLAMA_TIMEOUT', 120) timeout = getattr(settings, 'OLLAMA_TIMEOUT', 120)
# Configure Ollama with appropriate parameters for Arabic # Configure Ollama with appropriate parameters for Arabic

View File

@ -13,7 +13,7 @@ logger = logging.getLogger(__name__)
def get_llm_instance(): def get_llm_instance():
try: try:
base_url = getattr(settings, 'OLLAMA_BASE_URL', 'http://localhost:11434') base_url = getattr(settings, 'OLLAMA_BASE_URL', 'http://10.10.1.132:11434')
model = getattr(settings, 'OLLAMA_MODEL', 'qwen3:8b') model = getattr(settings, 'OLLAMA_MODEL', 'qwen3:8b')
temperature = getattr(settings, 'OLLAMA_TEMPERATURE', 0.2) temperature = getattr(settings, 'OLLAMA_TEMPERATURE', 0.2)
top_p = getattr(settings, 'OLLAMA_TOP_P', 0.8) top_p = getattr(settings, 'OLLAMA_TOP_P', 0.8)

View File

@ -404,7 +404,7 @@ def create_item_service(sender, instance, created, **kwargs):
if created: if created:
entity = instance.dealer.entity entity = instance.dealer.entity
uom = entity.get_uom_all().get(unit_abbr=instance.uom) uom = entity.get_uom_all().get(unit_abbr=instance.uom)
cogs = entity.get_all_accounts().get(role=roles.COGS) cogs = entity.get_all_accounts().filter(role=roles.COGS,active=True,role_default=True).first()
service_model = ItemModel.objects.create( service_model = ItemModel.objects.create(
name=instance.name, name=instance.name,