From 0fb6c23c84872b4550089f4d3e5bf31eb73e2dac Mon Sep 17 00:00:00 2001 From: lasseedfast Date: Wed, 16 Oct 2024 10:22:10 +0200 Subject: [PATCH] Refactor test.py to import necessary modules, update code structure, and generate response from LLM model --- test.py | 25 +++++++++++++++++-------- 1 file changed, 17 insertions(+), 8 deletions(-) diff --git a/test.py b/test.py index af95fba..154dfe2 100644 --- a/test.py +++ b/test.py @@ -1,10 +1,19 @@ from _arango import ArangoDB + arango = ArangoDB() -initiatives = [i for i in arango.db.collection('eu_initiatives').all()] -ordered_by_headline = sorted(initiatives, key=lambda x: x['headline']) - -s = set() -for i in ordered_by_headline: - print(i['headline']) - s.add(i['headline']) -print(len(s)) \ No newline at end of file +initiatives = [i for i in arango.db.collection("eu_initiatives").all()] +ordered_by_headline = sorted(initiatives, key=lambda x: x["headline"]) +import env_manager +import os +from ollama import Client +import httpx + + +ollama = Client( + os.getenv("https://lasseedfast.se/api/chat/"), + auth=httpx.BasicAuth(username="lasse", password="p239q8wimerxr2m389"), +) + +ollama.generate( + "What is the European Green Deal?" +) # This will generate a response from the LLM model