machine-thinking 0.0.2__tar.gz → 0.0.3__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.
@@ -0,0 +1,69 @@
1
+ Metadata-Version: 2.4
2
+ Name: machine-thinking
3
+ Version: 0.0.3
4
+ Summary: Package description
5
+ Author-email: Machina Ratiocinatrix <machina.ratio@gmail.com>, Alexander Fedotov <alex.fedotov@aol.com>
6
+ Project-URL: Homepage, https://github.com/machina-ratiocinatrix/machine-thinking
7
+ Project-URL: Bug Tracker, https://github.com/machina-ratiocinatrix/machine-thinking/issues
8
+ Keywords: machine-thinking
9
+ Classifier: Programming Language :: Python :: 3
10
+ Classifier: License :: OSI Approved :: MIT License
11
+ Classifier: Operating System :: OS Independent
12
+ Requires-Python: >=3.10
13
+ Description-Content-Type: text/markdown
14
+ License-File: LICENSE
15
+ Requires-Dist: pyyaml==6.0.3
16
+ Dynamic: license-file
17
+
18
+ # Machine thinking
19
+ Tinker API calls to Inkling model without dependencies.
20
+ <pre>
21
+ pip install machine-thinking
22
+ </pre>
23
+ Then:
24
+ ```Python
25
+ # Python
26
+ from yaml import safe_load as yl
27
+ from machine_thinking.chat import chat_complete as cc
28
+
29
+ kwargs = """ # this is a string in YAML format
30
+ max_tokens: 32000
31
+ stop_sequences:
32
+ - STOP
33
+ - "\nTitle"
34
+ temperature: 1.0
35
+ top_k: 10
36
+ top_p: 0.5
37
+ reasoning_effort: high
38
+ """
39
+
40
+ instruction = 'You are a helpful assistant. Do not use markdown or lists in your responses.'
41
+
42
+ weather_tool = """ # YAML definition of a function (old format)
43
+ type: function
44
+ function:
45
+ name: get_weather
46
+ description: Determine weather in a location
47
+ parameters:
48
+ type: object
49
+ properties:
50
+ location:
51
+ type: string
52
+ description: The city and state, e.g. San Francisco, CA
53
+ additionalProperties: false
54
+ required:
55
+ - location
56
+ """
57
+
58
+ tools = [yl(weather_tool)]
59
+
60
+ msgs = [{'role': 'user', 'content': 'What is the weather in Chicago, IL and Paris, France?'}]
61
+
62
+ thoughts, text = cc(
63
+ messages=msgs,
64
+ instructions=instruction,
65
+ tools=tools,
66
+ **yl(kwargs)
67
+ )
68
+ ```
69
+
@@ -0,0 +1,52 @@
1
+ # Machine thinking
2
+ Tinker API calls to Inkling model without dependencies.
3
+ <pre>
4
+ pip install machine-thinking
5
+ </pre>
6
+ Then:
7
+ ```Python
8
+ # Python
9
+ from yaml import safe_load as yl
10
+ from machine_thinking.chat import chat_complete as cc
11
+
12
+ kwargs = """ # this is a string in YAML format
13
+ max_tokens: 32000
14
+ stop_sequences:
15
+ - STOP
16
+ - "\nTitle"
17
+ temperature: 1.0
18
+ top_k: 10
19
+ top_p: 0.5
20
+ reasoning_effort: high
21
+ """
22
+
23
+ instruction = 'You are a helpful assistant. Do not use markdown or lists in your responses.'
24
+
25
+ weather_tool = """ # YAML definition of a function (old format)
26
+ type: function
27
+ function:
28
+ name: get_weather
29
+ description: Determine weather in a location
30
+ parameters:
31
+ type: object
32
+ properties:
33
+ location:
34
+ type: string
35
+ description: The city and state, e.g. San Francisco, CA
36
+ additionalProperties: false
37
+ required:
38
+ - location
39
+ """
40
+
41
+ tools = [yl(weather_tool)]
42
+
43
+ msgs = [{'role': 'user', 'content': 'What is the weather in Chicago, IL and Paris, France?'}]
44
+
45
+ thoughts, text = cc(
46
+ messages=msgs,
47
+ instructions=instruction,
48
+ tools=tools,
49
+ **yl(kwargs)
50
+ )
51
+ ```
52
+
@@ -3,7 +3,7 @@ requires = ["setuptools>=67.0"]
3
3
  build-backend = "setuptools.build_meta"
4
4
  [project]
5
5
  name = "machine-thinking"
6
- version = "0.0.2"
6
+ version = "0.0.3"
7
7
  authors = [
8
8
  {name="Machina Ratiocinatrix", email="machina.ratio@gmail.com"},
9
9
  {name="Alexander Fedotov", email="alex.fedotov@aol.com"}
@@ -13,19 +13,11 @@ from .utils import (query,
13
13
 
14
14
 
15
15
  def get_weather(location):
16
- # print(f"Executing weather tool for location: {location}")
17
16
  return {"temperature": "72F", "condition": "Sunny"}
18
17
 
19
18
 
20
19
  def chat_complete(messages=None, instructions=None, tools=None, **kwargs):
21
- """A continuation of text with a given context and instruction.
22
- kwargs:
23
- temperature = 0 to 1.0
24
- top_p = 0.0 to 1.0
25
- top_k = The maximum number of tokens to consider when sampling.
26
- n = 1 is mandatory for this method continuationS have n > 1
27
- max_tokens = number of tokens
28
- stop = ['stop'] array of up to 4 sequences
20
+ """
29
21
  """
30
22
  instruction = kwargs.get('system_instruction', instructions)
31
23
  first_message = [dict(role='system', content=instruction)] if instruction else []
@@ -0,0 +1,69 @@
1
+ Metadata-Version: 2.4
2
+ Name: machine-thinking
3
+ Version: 0.0.3
4
+ Summary: Package description
5
+ Author-email: Machina Ratiocinatrix <machina.ratio@gmail.com>, Alexander Fedotov <alex.fedotov@aol.com>
6
+ Project-URL: Homepage, https://github.com/machina-ratiocinatrix/machine-thinking
7
+ Project-URL: Bug Tracker, https://github.com/machina-ratiocinatrix/machine-thinking/issues
8
+ Keywords: machine-thinking
9
+ Classifier: Programming Language :: Python :: 3
10
+ Classifier: License :: OSI Approved :: MIT License
11
+ Classifier: Operating System :: OS Independent
12
+ Requires-Python: >=3.10
13
+ Description-Content-Type: text/markdown
14
+ License-File: LICENSE
15
+ Requires-Dist: pyyaml==6.0.3
16
+ Dynamic: license-file
17
+
18
+ # Machine thinking
19
+ Tinker API calls to Inkling model without dependencies.
20
+ <pre>
21
+ pip install machine-thinking
22
+ </pre>
23
+ Then:
24
+ ```Python
25
+ # Python
26
+ from yaml import safe_load as yl
27
+ from machine_thinking.chat import chat_complete as cc
28
+
29
+ kwargs = """ # this is a string in YAML format
30
+ max_tokens: 32000
31
+ stop_sequences:
32
+ - STOP
33
+ - "\nTitle"
34
+ temperature: 1.0
35
+ top_k: 10
36
+ top_p: 0.5
37
+ reasoning_effort: high
38
+ """
39
+
40
+ instruction = 'You are a helpful assistant. Do not use markdown or lists in your responses.'
41
+
42
+ weather_tool = """ # YAML definition of a function (old format)
43
+ type: function
44
+ function:
45
+ name: get_weather
46
+ description: Determine weather in a location
47
+ parameters:
48
+ type: object
49
+ properties:
50
+ location:
51
+ type: string
52
+ description: The city and state, e.g. San Francisco, CA
53
+ additionalProperties: false
54
+ required:
55
+ - location
56
+ """
57
+
58
+ tools = [yl(weather_tool)]
59
+
60
+ msgs = [{'role': 'user', 'content': 'What is the weather in Chicago, IL and Paris, France?'}]
61
+
62
+ thoughts, text = cc(
63
+ messages=msgs,
64
+ instructions=instruction,
65
+ tools=tools,
66
+ **yl(kwargs)
67
+ )
68
+ ```
69
+
@@ -1,26 +0,0 @@
1
- Metadata-Version: 2.4
2
- Name: machine-thinking
3
- Version: 0.0.2
4
- Summary: Package description
5
- Author-email: Machina Ratiocinatrix <machina.ratio@gmail.com>, Alexander Fedotov <alex.fedotov@aol.com>
6
- Project-URL: Homepage, https://github.com/machina-ratiocinatrix/machine-thinking
7
- Project-URL: Bug Tracker, https://github.com/machina-ratiocinatrix/machine-thinking/issues
8
- Keywords: machine-thinking
9
- Classifier: Programming Language :: Python :: 3
10
- Classifier: License :: OSI Approved :: MIT License
11
- Classifier: Operating System :: OS Independent
12
- Requires-Python: >=3.10
13
- Description-Content-Type: text/markdown
14
- License-File: LICENSE
15
- Requires-Dist: pyyaml==6.0.3
16
- Dynamic: license-file
17
-
18
- # Machine thinking
19
- <pre>
20
- pip install machine-thinking
21
- </pre>
22
- Then:
23
- ```Python
24
- # Python
25
- import machine_thinking
26
- ```
@@ -1,9 +0,0 @@
1
- # Machine thinking
2
- <pre>
3
- pip install machine-thinking
4
- </pre>
5
- Then:
6
- ```Python
7
- # Python
8
- import machine_thinking
9
- ```
@@ -1,26 +0,0 @@
1
- Metadata-Version: 2.4
2
- Name: machine-thinking
3
- Version: 0.0.2
4
- Summary: Package description
5
- Author-email: Machina Ratiocinatrix <machina.ratio@gmail.com>, Alexander Fedotov <alex.fedotov@aol.com>
6
- Project-URL: Homepage, https://github.com/machina-ratiocinatrix/machine-thinking
7
- Project-URL: Bug Tracker, https://github.com/machina-ratiocinatrix/machine-thinking/issues
8
- Keywords: machine-thinking
9
- Classifier: Programming Language :: Python :: 3
10
- Classifier: License :: OSI Approved :: MIT License
11
- Classifier: Operating System :: OS Independent
12
- Requires-Python: >=3.10
13
- Description-Content-Type: text/markdown
14
- License-File: LICENSE
15
- Requires-Dist: pyyaml==6.0.3
16
- Dynamic: license-file
17
-
18
- # Machine thinking
19
- <pre>
20
- pip install machine-thinking
21
- </pre>
22
- Then:
23
- ```Python
24
- # Python
25
- import machine_thinking
26
- ```