electroid 0.0.7__tar.gz → 0.0.9__tar.gz
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.
- {electroid-0.0.7 → electroid-0.0.9}/PKG-INFO +6 -1
- {electroid-0.0.7 → electroid-0.0.9}/pyproject.toml +10 -1
- {electroid-0.0.7 → electroid-0.0.9}/src/electroid/__init__.py +1 -0
- electroid-0.0.9/src/electroid/anthropic.py +45 -0
- {electroid-0.0.7 → electroid-0.0.9}/src/electroid/roid.py +2 -2
- {electroid-0.0.7 → electroid-0.0.9}/src/electroid.egg-info/PKG-INFO +6 -1
- {electroid-0.0.7 → electroid-0.0.9}/src/electroid.egg-info/SOURCES.txt +2 -0
- electroid-0.0.9/src/electroid.egg-info/requires.txt +5 -0
- {electroid-0.0.7 → electroid-0.0.9}/LICENSE +0 -0
- {electroid-0.0.7 → electroid-0.0.9}/README.md +0 -0
- {electroid-0.0.7 → electroid-0.0.9}/setup.cfg +0 -0
- {electroid-0.0.7 → electroid-0.0.9}/src/electroid.egg-info/dependency_links.txt +0 -0
- {electroid-0.0.7 → electroid-0.0.9}/src/electroid.egg-info/top_level.txt +0 -0
|
@@ -1,16 +1,21 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: electroid
|
|
3
|
-
Version: 0.0.
|
|
3
|
+
Version: 0.0.9
|
|
4
4
|
Summary: Anthropomorphized electric power consumption.
|
|
5
5
|
Author-email: Alexander Fedotov <alex.fedotov@aol.com>
|
|
6
6
|
Project-URL: Homepage, https://github.com/alxfed/electroid
|
|
7
7
|
Project-URL: Bug Tracker, https://github.com/alxfed/electroid/issues
|
|
8
|
+
Keywords: electroid
|
|
8
9
|
Classifier: Programming Language :: Python :: 3
|
|
9
10
|
Classifier: License :: OSI Approved :: MIT License
|
|
10
11
|
Classifier: Operating System :: OS Independent
|
|
11
12
|
Requires-Python: >=3.10
|
|
12
13
|
Description-Content-Type: text/markdown
|
|
13
14
|
License-File: LICENSE
|
|
15
|
+
Requires-Dist: requests>=2.32.5
|
|
16
|
+
Requires-Dist: urllib3>=1.26.5
|
|
17
|
+
Provides-Extra: anthropic-native
|
|
18
|
+
Requires-Dist: anthropic>=0.78.0; extra == "anthropic-native"
|
|
14
19
|
Dynamic: license-file
|
|
15
20
|
|
|
16
21
|
# Electroid
|
|
@@ -3,7 +3,7 @@ requires = ["setuptools>=67.0"]
|
|
|
3
3
|
build-backend = "setuptools.build_meta"
|
|
4
4
|
[project]
|
|
5
5
|
name = "electroid"
|
|
6
|
-
version = "0.0.
|
|
6
|
+
version = "0.0.9"
|
|
7
7
|
authors = [
|
|
8
8
|
{name="Alexander Fedotov", email="alex.fedotov@aol.com"},
|
|
9
9
|
]
|
|
@@ -15,6 +15,15 @@ classifiers=[
|
|
|
15
15
|
"License :: OSI Approved :: MIT License",
|
|
16
16
|
"Operating System :: OS Independent",
|
|
17
17
|
]
|
|
18
|
+
keywords = ["electroid"]
|
|
19
|
+
dependencies = [
|
|
20
|
+
"requests >= 2.32.5",
|
|
21
|
+
"urllib3 >= 1.26.5"
|
|
22
|
+
]
|
|
23
|
+
|
|
24
|
+
[project.optional-dependencies]
|
|
25
|
+
anthropic_native = ["anthropic >= 0.78.0"]
|
|
26
|
+
|
|
18
27
|
[project.urls]
|
|
19
28
|
"Homepage" = "https://github.com/alxfed/electroid"
|
|
20
29
|
"Bug Tracker" = "https://github.com/alxfed/electroid/issues"
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
# -*- coding: utf-8 -*-
|
|
2
|
+
# Python
|
|
3
|
+
|
|
4
|
+
"""Copyright (c) Alexander Fedotov.
|
|
5
|
+
This source code is licensed under the license found in the
|
|
6
|
+
LICENSE file in the root directory of this source tree.
|
|
7
|
+
"""
|
|
8
|
+
from os import environ
|
|
9
|
+
import anthropic
|
|
10
|
+
|
|
11
|
+
api_key = environ.get("ANTHROPIC_API_KEY", '')
|
|
12
|
+
default_model = environ.get("ANTHROPIC_DEFAULT_MODEL", 'claude-opus-4-6')
|
|
13
|
+
message_model = environ.get("ANTHROPIC_MESSAGE_MODEL", 'claude-opus-4-6')
|
|
14
|
+
|
|
15
|
+
client = anthropic.Anthropic()
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
def cloud(messages=None, **kwargs):
|
|
19
|
+
""" All parameters should be in kwargs, but they are optional
|
|
20
|
+
"""
|
|
21
|
+
|
|
22
|
+
try:
|
|
23
|
+
response = client.messages.create(
|
|
24
|
+
model=kwargs.get("model", default_model),
|
|
25
|
+
thinking={"type": kwargs.get("thinking", "adaptive")},
|
|
26
|
+
system=kwargs.get("system", "answer concisely"),
|
|
27
|
+
messages=messages,
|
|
28
|
+
max_tokens=kwargs.get("max_tokens", 100),
|
|
29
|
+
stop_sequences = kwargs.get("stop_sequences", ['stop']),
|
|
30
|
+
stream = kwargs.get("stream", False),
|
|
31
|
+
temperature = kwargs.get("temperature", 0.5),
|
|
32
|
+
top_k = kwargs.get("top_k", 10),
|
|
33
|
+
output_config = kwargs.get("output_config", {"effort": "low"}),
|
|
34
|
+
metadata = kwargs.get("metadata", None)
|
|
35
|
+
)
|
|
36
|
+
return response.content
|
|
37
|
+
|
|
38
|
+
except Exception as e:
|
|
39
|
+
print("Unable to generate Message response")
|
|
40
|
+
print(f"Exception: {e}")
|
|
41
|
+
return ''
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
if __name__ == "__main__":
|
|
45
|
+
print("you launched main.")
|
|
@@ -28,14 +28,14 @@ def messages(messages=None, **kwargs):
|
|
|
28
28
|
"""
|
|
29
29
|
json_data = {
|
|
30
30
|
"model": kwargs.get("model", default_model),
|
|
31
|
-
"thinking": kwargs.get("thinking", "
|
|
31
|
+
"thinking": {"type": kwargs.get("thinking", "enabled")},
|
|
32
32
|
"system": kwargs.get("system", "answer concisely"),
|
|
33
33
|
"messages": messages,
|
|
34
34
|
"max_tokens": kwargs.get("max_tokens", 100),
|
|
35
35
|
"stop_sequences": kwargs.get("stop_sequences",['stop']),
|
|
36
36
|
"stream": kwargs.get("stream", False),
|
|
37
37
|
"temperature": kwargs.get("temperature", 0.5),
|
|
38
|
-
"top_k": kwargs.get("top_k",
|
|
38
|
+
"top_k": kwargs.get("top_k", 10),
|
|
39
39
|
"output_config": kwargs.get("output_config", {"effort":"low"}),
|
|
40
40
|
"metadata": kwargs.get("metadata", None)
|
|
41
41
|
}
|
|
@@ -1,16 +1,21 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: electroid
|
|
3
|
-
Version: 0.0.
|
|
3
|
+
Version: 0.0.9
|
|
4
4
|
Summary: Anthropomorphized electric power consumption.
|
|
5
5
|
Author-email: Alexander Fedotov <alex.fedotov@aol.com>
|
|
6
6
|
Project-URL: Homepage, https://github.com/alxfed/electroid
|
|
7
7
|
Project-URL: Bug Tracker, https://github.com/alxfed/electroid/issues
|
|
8
|
+
Keywords: electroid
|
|
8
9
|
Classifier: Programming Language :: Python :: 3
|
|
9
10
|
Classifier: License :: OSI Approved :: MIT License
|
|
10
11
|
Classifier: Operating System :: OS Independent
|
|
11
12
|
Requires-Python: >=3.10
|
|
12
13
|
Description-Content-Type: text/markdown
|
|
13
14
|
License-File: LICENSE
|
|
15
|
+
Requires-Dist: requests>=2.32.5
|
|
16
|
+
Requires-Dist: urllib3>=1.26.5
|
|
17
|
+
Provides-Extra: anthropic-native
|
|
18
|
+
Requires-Dist: anthropic>=0.78.0; extra == "anthropic-native"
|
|
14
19
|
Dynamic: license-file
|
|
15
20
|
|
|
16
21
|
# Electroid
|
|
@@ -2,8 +2,10 @@ LICENSE
|
|
|
2
2
|
README.md
|
|
3
3
|
pyproject.toml
|
|
4
4
|
src/electroid/__init__.py
|
|
5
|
+
src/electroid/anthropic.py
|
|
5
6
|
src/electroid/roid.py
|
|
6
7
|
src/electroid.egg-info/PKG-INFO
|
|
7
8
|
src/electroid.egg-info/SOURCES.txt
|
|
8
9
|
src/electroid.egg-info/dependency_links.txt
|
|
10
|
+
src/electroid.egg-info/requires.txt
|
|
9
11
|
src/electroid.egg-info/top_level.txt
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|