cat-llm 0.0.53__py3-none-any.whl → 0.0.54__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {cat_llm-0.0.53.dist-info → cat_llm-0.0.54.dist-info}/METADATA +4 -2
- {cat_llm-0.0.53.dist-info → cat_llm-0.0.54.dist-info}/RECORD +6 -6
- catllm/__about__.py +1 -1
- catllm/text_functions.py +31 -0
- {cat_llm-0.0.53.dist-info → cat_llm-0.0.54.dist-info}/WHEEL +0 -0
- {cat_llm-0.0.53.dist-info → cat_llm-0.0.54.dist-info}/licenses/LICENSE +0 -0
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: cat-llm
|
|
3
|
-
Version: 0.0.
|
|
3
|
+
Version: 0.0.54
|
|
4
4
|
Summary: A tool for categorizing text data and images using LLMs and vision models
|
|
5
5
|
Project-URL: Documentation, https://github.com/chrissoria/cat-llm#readme
|
|
6
6
|
Project-URL: Issues, https://github.com/chrissoria/cat-llm/issues
|
|
7
7
|
Project-URL: Source, https://github.com/chrissoria/cat-llm
|
|
8
|
-
Author-email:
|
|
8
|
+
Author-email: Chris Soria <chrissoria@berkeley.edu>
|
|
9
9
|
License-Expression: MIT
|
|
10
10
|
License-File: LICENSE
|
|
11
11
|
Keywords: categorizer,image classification,llm,structured output,survey data,text classification
|
|
@@ -19,7 +19,9 @@ Classifier: Programming Language :: Python :: 3.12
|
|
|
19
19
|
Classifier: Programming Language :: Python :: Implementation :: CPython
|
|
20
20
|
Classifier: Programming Language :: Python :: Implementation :: PyPy
|
|
21
21
|
Requires-Python: >=3.8
|
|
22
|
+
Requires-Dist: openai
|
|
22
23
|
Requires-Dist: pandas
|
|
24
|
+
Requires-Dist: requests
|
|
23
25
|
Requires-Dist: tqdm
|
|
24
26
|
Description-Content-Type: text/markdown
|
|
25
27
|
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
catllm/CERAD_functions.py,sha256=NNEu_Q10tClV7vRIVEgSQY8ujlXDbpWDzo1AbqlN7nQ,22462
|
|
2
|
-
catllm/__about__.py,sha256=
|
|
2
|
+
catllm/__about__.py,sha256=aaUp77jCD5GfUcnWYE3cYhgAzuymMUxVR6eleHYJIYA,404
|
|
3
3
|
catllm/__init__.py,sha256=sf02zp7N0NW0mAQi7eQ4gliWR1EwoqvXkHN2HwwjcTE,372
|
|
4
4
|
catllm/build_web_research.py,sha256=CYGhxnonJLBw80ATEBkpRjOKJgCYntHTgx4s4Pb8g88,6833
|
|
5
5
|
catllm/image_functions.py,sha256=Gz-djnXVaLT8GOR0sc8aPjjuC9L_gIT2AjUMjsjjmi0,35492
|
|
6
|
-
catllm/text_functions.py,sha256=
|
|
6
|
+
catllm/text_functions.py,sha256=bRkzBAg5G86466pF09gsR_zi0gJy81iKdvmjL5CvDOw,17911
|
|
7
7
|
catllm/images/circle.png,sha256=JWujAWAh08-TajAoEr_TAeFNLlfbryOLw6cgIBREBuQ,86202
|
|
8
8
|
catllm/images/cube.png,sha256=nFec3e5bmRe4zrBCJ8QK-HcJLrG7u7dYdKhmdMfacfE,77275
|
|
9
9
|
catllm/images/diamond.png,sha256=rJDZKtsnBGRO8FPA0iHuA8FvHFGi9PkI_DWSFdw6iv0,99568
|
|
10
10
|
catllm/images/overlapping_pentagons.png,sha256=VO5plI6eoVRnjfqinn1nNzsCP2WQhuQy71V0EASouW4,71208
|
|
11
11
|
catllm/images/rectangles.png,sha256=2XM16HO9EYWj2yHgN4bPXaCwPfl7iYQy0tQUGaJX9xg,40692
|
|
12
|
-
cat_llm-0.0.
|
|
13
|
-
cat_llm-0.0.
|
|
14
|
-
cat_llm-0.0.
|
|
15
|
-
cat_llm-0.0.
|
|
12
|
+
cat_llm-0.0.54.dist-info/METADATA,sha256=XoNc8RZEAq1xnKxsbKpXiDnBaKf73C5JZIjlB8ldVtA,21499
|
|
13
|
+
cat_llm-0.0.54.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
|
14
|
+
cat_llm-0.0.54.dist-info/licenses/LICENSE,sha256=Vje2sS5WV4TnIwY5uQHrF4qnBAM3YOk1pGpdH0ot-2o,34969
|
|
15
|
+
cat_llm-0.0.54.dist-info/RECORD,,
|
catllm/__about__.py
CHANGED
catllm/text_functions.py
CHANGED
|
@@ -307,6 +307,37 @@ Provide your work in JSON format where the number belonging to each category is
|
|
|
307
307
|
except Exception as e:
|
|
308
308
|
print(f"An error occurred: {e}")
|
|
309
309
|
link1.append(f"Error processing input: {e}")
|
|
310
|
+
|
|
311
|
+
elif model_source == "Google":
|
|
312
|
+
import requests
|
|
313
|
+
url = f"https://generativelanguage.googleapis.com/v1beta/models/{user_model}:generateContent"
|
|
314
|
+
try:
|
|
315
|
+
headers = {
|
|
316
|
+
"x-goog-api-key": api_key,
|
|
317
|
+
"Content-Type": "application/json"
|
|
318
|
+
}
|
|
319
|
+
|
|
320
|
+
payload = {
|
|
321
|
+
"contents": [{
|
|
322
|
+
"parts": [{"text": prompt}]
|
|
323
|
+
}]
|
|
324
|
+
}
|
|
325
|
+
|
|
326
|
+
response = requests.post(url, headers=headers, json=payload)
|
|
327
|
+
response.raise_for_status() # Raise exception for HTTP errors
|
|
328
|
+
result = response.json()
|
|
329
|
+
|
|
330
|
+
if "candidates" in result and result["candidates"]:
|
|
331
|
+
reply = result["candidates"][0]["content"]["parts"][0]["text"]
|
|
332
|
+
else:
|
|
333
|
+
reply = "No response generated"
|
|
334
|
+
|
|
335
|
+
link1.append(reply)
|
|
336
|
+
print(reply)
|
|
337
|
+
except Exception as e:
|
|
338
|
+
print(f"An error occurred: {e}")
|
|
339
|
+
link1.append(f"Error processing input: {e}")
|
|
340
|
+
|
|
310
341
|
elif model_source == "Mistral":
|
|
311
342
|
from mistralai import Mistral
|
|
312
343
|
client = Mistral(api_key=api_key)
|
|
File without changes
|
|
File without changes
|