osmosis-ai 0.1.7__py3-none-any.whl → 0.1.8__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.

Potentially problematic release.


This version of osmosis-ai might be problematic. Click here for more details.

osmosis_ai/__init__.py CHANGED
@@ -15,7 +15,7 @@ Currently supported adapters:
15
15
  def _import_modules():
16
16
  global utils, logger, reconfigure_logger
17
17
  global set_log_destination, log_destination, LogDestination
18
- global init, enabled, disable_osmosis, enable_osmosis
18
+ global init, enabled, disable_osmosis, enable_osmosis, osmosis_reward
19
19
 
20
20
  from . import utils
21
21
  from .logger import logger, reconfigure_logger, set_log_destination, log_destination
@@ -30,6 +30,9 @@ def _import_modules():
30
30
 
31
31
  # Re-export initialization function
32
32
  init = utils.init
33
+
34
+ # Export the reward decorator
35
+ osmosis_reward = utils.osmosis_reward
33
36
 
34
37
  # Initialize wrappers as None
35
38
  global wrap_anthropic, wrap_openai, wrap_langchain
osmosis_ai/consts.py CHANGED
@@ -2,7 +2,7 @@ from enum import Enum
2
2
 
3
3
  # Extract package metadata
4
4
  package_name = "osmosis-ai"
5
- package_version = "0.1.7"
5
+ package_version = "0.1.8"
6
6
 
7
7
  indent = 2 # Number of spaces to use for indentation in pretty print
8
8
  osmosis_api_url = "https://osmosis.gulp.dev"
osmosis_ai/utils.py CHANGED
@@ -4,8 +4,9 @@ Utility functions for osmosisadapters
4
4
 
5
5
  import json
6
6
  from datetime import datetime, timezone
7
- from typing import Any, Dict
7
+ from typing import Any, Dict, Callable
8
8
  import xxhash
9
+ import functools
9
10
 
10
11
  # Import constants
11
12
  from .consts import osmosis_api_url
@@ -95,3 +96,25 @@ def send_to_osmosis(
95
96
  )
96
97
  except Exception as e:
97
98
  logger.warning(f"Failed to send data to OSMOSIS API: {str(e)}")
99
+
100
+
101
+ def osmosis_reward(func: Callable) -> Callable:
102
+ """
103
+ Decorator for reward functions.
104
+
105
+ Args:
106
+ func: The reward function to be wrapped
107
+
108
+ Returns:
109
+ The wrapped function
110
+
111
+ Example:
112
+ @osmosis_reward
113
+ def calculate_reward(state, action):
114
+ return state.score + action.value
115
+ """
116
+ @functools.wraps(func)
117
+ def wrapper(*args, **kwargs):
118
+ return func(*args, **kwargs)
119
+
120
+ return wrapper
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: osmosis-ai
3
- Version: 0.1.7
3
+ Version: 0.1.8
4
4
  Summary: Monkey patches LLM client libraries to print all prompts and responses
5
5
  Author-email: Gulp AI <jake@gulp.ai>
6
6
  License: MIT License
@@ -1,15 +1,15 @@
1
- osmosis_ai/__init__.py,sha256=esOnyFqlu7-AKuxTV5fkLVb34-kvCReMEDFkFpxBH7M,4374
2
- osmosis_ai/consts.py,sha256=1HavvPFM9nJCDqy1RK7VH_g9MbAgXNyBqN8Rt3FAeDE,408
1
+ osmosis_ai/__init__.py,sha256=p6SXDKMc-AUoFSJSOCgM6zvIEYJ6IrqtymqBNAB8lW4,4471
2
+ osmosis_ai/consts.py,sha256=tZ3duER7kZ5bxMdMfMiwFlsSRmOaIpTReu19NPBuZPc,408
3
3
  osmosis_ai/logger.py,sha256=J2Yw_QMGqXySzJlj_QQqHLs52S1oKYXoELnU66YCAuI,2170
4
- osmosis_ai/utils.py,sha256=pJDJTO1ov0Nyyj6UMbPGZIAPyoF-wY9QM3hYoxtIuo4,2490
4
+ osmosis_ai/utils.py,sha256=l46vQYLZEUCFSCCUlM9tCgNgDV-WzIwzwTwR8K3vZ4I,2992
5
5
  osmosis_ai/adapters/__init__.py,sha256=MlS3aGG8AQqQUQlV196sPdChTvfenK6ZdSaP0Tsr8eQ,262
6
6
  osmosis_ai/adapters/anthropic.py,sha256=Q9pb_AxgaSTyjNYkGGZL5mslyVnfTbGI04WbxLDhvLA,22959
7
7
  osmosis_ai/adapters/langchain.py,sha256=oVIIRmpdadgozoysJBxoJsTVwJcjrtoA63SjRchXr9E,27673
8
8
  osmosis_ai/adapters/langchain_anthropic.py,sha256=qWtcNAQ3tQpJfTttV9y5mMCkPujuRodoFkaoYx9pOW8,14557
9
9
  osmosis_ai/adapters/langchain_openai.py,sha256=8sq4vGSqm96-UjeeiW0ZGWMOUXiv85A1BLGwaeboBF8,24815
10
10
  osmosis_ai/adapters/openai.py,sha256=B-dNQvA8XcmX4kB5ZZGf4EoS_VAVZPo3aTfem_xe-8I,39437
11
- osmosis_ai-0.1.7.dist-info/licenses/LICENSE,sha256=WLvxAm2-fPuT8qECE6ejD8ezG9btIanJl7zysXvtQgM,1064
12
- osmosis_ai-0.1.7.dist-info/METADATA,sha256=wVZ0LQAJIfGKinOoQrgCUKwCOf667InqQxOYIWBBv_Q,9255
13
- osmosis_ai-0.1.7.dist-info/WHEEL,sha256=CmyFI0kx5cdEMTLiONQRbGQwjIoR1aIYB7eCAQ4KPJ0,91
14
- osmosis_ai-0.1.7.dist-info/top_level.txt,sha256=UPNRTKIBSrxsJVNxwXnLCqSoBS4bAiL_3jMtjvf5zEY,11
15
- osmosis_ai-0.1.7.dist-info/RECORD,,
11
+ osmosis_ai-0.1.8.dist-info/licenses/LICENSE,sha256=WLvxAm2-fPuT8qECE6ejD8ezG9btIanJl7zysXvtQgM,1064
12
+ osmosis_ai-0.1.8.dist-info/METADATA,sha256=Zeuhm80tBeJXhG6OMvVplbH52VjQnOFsd5z2PAEBfEU,9255
13
+ osmosis_ai-0.1.8.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
14
+ osmosis_ai-0.1.8.dist-info/top_level.txt,sha256=UPNRTKIBSrxsJVNxwXnLCqSoBS4bAiL_3jMtjvf5zEY,11
15
+ osmosis_ai-0.1.8.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: setuptools (78.1.0)
2
+ Generator: setuptools (80.9.0)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5