This commit is contained in:
Luciano Gervasoni
2025-03-07 00:48:20 +01:00
parent 54ebd58070
commit ec4a2cad15

View File

@@ -64,19 +64,18 @@ def url_detail_view(request, id):
url_content = UrlContent.objects.get(pk=id)
except UrlContent.DoesNotExist:
url_content = {}
#print(url_content.__dict__)
# TODO: https://github.com/ollama/ollama-python?tab=readme-ov-file#async-client
# LLM models available
client = ollama.Client(host = 'https://ollamamodel.matitos.org')
models = sorted([m.model for m in client.list().models])
print(models)
# default_model = "llama3.2:3b"
context = {
'url_item': url_item,
'sources': url_sources,
'models': models,
#'default_model': default_model,
'prompt': "Provide in one paragraph the what, why, when, where, who, and how of the content below. Also provide a one paragraph summary of the content:",
#"prompt": "Image you are a journalist, TLDR in a paragraph:",
#"prompt": "Below you will find the whole content of a news article:\n{}\nProvide a concise summary of one paragraph maximum of the content.".format(content)