electroid 0.0.7__tar.gz → 0.0.8__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.
@@ -1,16 +1,21 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: electroid
3
- Version: 0.0.7
3
+ Version: 0.0.8
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.7"
6
+ version = "0.0.8"
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"
@@ -6,6 +6,7 @@ This source code is licensed under the license found in the
6
6
  LICENSE file in the root directory of this source tree.
7
7
  """
8
8
  from .roid import messages
9
+ from .anthropic import cloud
9
10
 
10
11
  __all__ = [
11
12
  'messages'
@@ -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
+ kwa = {
22
+ "model": kwargs.get("model", default_model),
23
+ "thinking": kwargs.get("thinking", "adaptive"),
24
+ "system": kwargs.get("system", "answer concisely"),
25
+ "messages": messages,
26
+ "max_tokens": kwargs.get("max_tokens", 100),
27
+ "stop_sequences": kwargs.get("stop_sequences",['stop']),
28
+ "stream": kwargs.get("stream", False),
29
+ "temperature": kwargs.get("temperature", 0.5),
30
+ "top_k": kwargs.get("top_k", 10),
31
+ "output_config": kwargs.get("output_config", {"effort":"low"}),
32
+ "metadata": kwargs.get("metadata", None)
33
+ }
34
+ try:
35
+ response = client.messages.create(**kwa)
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.")
@@ -35,7 +35,7 @@ def messages(messages=None, **kwargs):
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", None),
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.7
3
+ Version: 0.0.8
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
@@ -0,0 +1,5 @@
1
+ requests>=2.32.5
2
+ urllib3>=1.26.5
3
+
4
+ [anthropic_native]
5
+ anthropic>=0.78.0
File without changes
File without changes
File without changes