fluxloop 0.1.0__py3-none-any.whl → 0.1.1__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 fluxloop might be problematic. Click here for more details.

fluxloop/__init__.py CHANGED
@@ -18,10 +18,10 @@ from .schemas import (
18
18
  TraceStatus,
19
19
  )
20
20
  from .client import FluxLoopClient
21
- from .config import configure, get_config, reset_config
21
+ from .config import configure, get_config, reset_config, load_env
22
22
  from .recording import disable_recording, enable_recording, record_call_args, set_recording_options
23
23
 
24
- __version__ = "0.1.0"
24
+ __version__ = "0.1.1"
25
25
 
26
26
  __all__ = [
27
27
  # Decorators
@@ -36,6 +36,7 @@ __all__ = [
36
36
  "FluxLoopClient",
37
37
  # Config
38
38
  "configure",
39
+ "load_env",
39
40
  "get_config",
40
41
  "reset_config",
41
42
  "enable_recording",
fluxloop/config.py CHANGED
@@ -14,6 +14,27 @@ from pydantic import BaseModel, Field, field_validator
14
14
  from .recording import disable_recording, enable_recording
15
15
 
16
16
 
17
+ def load_env(dotenv_path: Optional[str] = None, *, override: bool = False) -> bool:
18
+ """Load environment variables for FluxLoop.
19
+
20
+ Args:
21
+ dotenv_path: Optional path to a specific `.env` file or containing directory.
22
+ override: Whether to override existing environment variables.
23
+
24
+ Returns:
25
+ True if the env file was found and loaded, False otherwise.
26
+ """
27
+
28
+ if dotenv_path is None:
29
+ return load_dotenv(override=override)
30
+
31
+ candidate = Path(dotenv_path).expanduser()
32
+ if candidate.is_dir():
33
+ candidate = candidate / ".env"
34
+
35
+ return load_dotenv(dotenv_path=str(candidate), override=override)
36
+
37
+
17
38
  def _resolve_recording_path(path: Optional[str]) -> Path:
18
39
  """Resolve the recording file path, creating parent directories."""
19
40
 
@@ -42,8 +63,8 @@ def _apply_recording_config(config: "SDKConfig") -> None:
42
63
  if config.debug:
43
64
  print("🎥 Argument recording disabled")
44
65
 
45
- # Load environment variables
46
- load_dotenv()
66
+ # Load environment variables (default behaviour on import)
67
+ load_env()
47
68
 
48
69
 
49
70
  class SDKConfig(BaseModel):
@@ -13,6 +13,7 @@ class VariationStrategy(str, Enum):
13
13
  """Strategy for generating prompt variations."""
14
14
 
15
15
  REPHRASE = "rephrase" # Rephrase the same intent
16
+ ERROR_PRONE = "error_prone" # Introduce mistakes to test robustness
16
17
  TYPO = "typo" # Add typos/errors
17
18
  VERBOSE = "verbose" # Make more verbose
18
19
  CONCISE = "concise" # Make more concise
@@ -142,6 +143,23 @@ class RunnerConfig(BaseModel):
142
143
  "module_path + function_name."
143
144
  ),
144
145
  )
146
+ factory: Optional[str] = Field(
147
+ default=None,
148
+ description=(
149
+ "Optional factory to construct instances when target references a class or bound method. "
150
+ "Use 'module:callable' format; callable must return the instance."
151
+ ),
152
+ )
153
+ factory_kwargs: Dict[str, Any] = Field(
154
+ default_factory=dict,
155
+ description="Keyword arguments to pass to the factory callable, if provided.",
156
+ )
157
+ stream_output_path: Optional[str] = Field(
158
+ default=None,
159
+ description=(
160
+ "Dot-notation path for extracting text from async generator events (e.g., 'message.delta')."
161
+ ),
162
+ )
145
163
 
146
164
  # Execution environment
147
165
  working_directory: Optional[str] = None
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: fluxloop
3
- Version: 0.1.0
3
+ Version: 0.1.1
4
4
  Summary: FluxLoop SDK for agent instrumentation and tracing
5
5
  Author-email: FluxLoop Team <team@fluxloop.dev>
6
6
  License: Apache-2.0
@@ -1,7 +1,7 @@
1
- fluxloop/__init__.py,sha256=TomDcCLgeFB1LG3NpspyFVQ3bd5HNr4CPA2etl5XXKs,1248
1
+ fluxloop/__init__.py,sha256=wK3FC9Ik8a3wQXkNkgzZTXfEDvYxUduJ99weN1GV_HE,1274
2
2
  fluxloop/buffer.py,sha256=pbviGFU0P_HlBYOlZccVuaj7OcQ5-M0L8d7r_vF1hQg,5940
3
3
  fluxloop/client.py,sha256=4WCi1de8MJW-5La-ZalVYEaN7-gUFHlr6mByi1bBoc0,5487
4
- fluxloop/config.py,sha256=A7hekvUFpQCeAcOEqj7d4fW8dvPihfaQ51ZbamiOyGw,5723
4
+ fluxloop/config.py,sha256=TUkpwYCxi7z1BEuQmPbWEZKqGqp66ggp_Lqnyo-yvgI,6401
5
5
  fluxloop/context.py,sha256=09VTTSnn72E0wRf55PX5j355ngKE2GXaqCYpgBVgxMM,6458
6
6
  fluxloop/decorators.py,sha256=nfKIQpLwfMhr7A1TjtL-vppPWroPs98LsFB_1-ADfFM,15519
7
7
  fluxloop/models.py,sha256=5AQ2jqArRGwQB91GOBVrBRb1h5gJBghl5G81EClOUp8,2399
@@ -9,9 +9,9 @@ fluxloop/recording.py,sha256=lnhJI0fWJfgMGMjw6TA8wU66PbelfYyD2UzMJ02W-uI,6609
9
9
  fluxloop/serialization.py,sha256=SkY4bSUHxBrCkrPns-jWC1PkVSX8qh-oBprQTbmc5Z8,3239
10
10
  fluxloop/storage.py,sha256=siwlbGdUpFAzdI6MMnODtkuxJyftQG9D4Phs2s5quMs,1732
11
11
  fluxloop/schemas/__init__.py,sha256=przYFHTxNK7juJbqWZ2YVuCdBiMk3PB1H7T4xg3l62g,911
12
- fluxloop/schemas/config.py,sha256=ib7GZVfWgUh9flwix9oKEOijyG0lWZjNBxC9lLbKZDw,11120
12
+ fluxloop/schemas/config.py,sha256=n__U5aduQ5dIEs4cJNGSrD1jdpd-RAb03HhdOM7KlTk,11852
13
13
  fluxloop/schemas/trace.py,sha256=tkeYQon9pCTZLp1Ad3e-KM86xLaofIqxjHJ7l-mX0Bk,6270
14
- fluxloop-0.1.0.dist-info/METADATA,sha256=zeO_FZNKSlYYKAo-QDHZq2UJcbVqwWzGGfQ8ZSHWItM,2320
15
- fluxloop-0.1.0.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
16
- fluxloop-0.1.0.dist-info/top_level.txt,sha256=-whiUKvhn6Y7-TLfqrY7fZ1Cudjk8PnrKe7h7m8cuL4,9
17
- fluxloop-0.1.0.dist-info/RECORD,,
14
+ fluxloop-0.1.1.dist-info/METADATA,sha256=7wQlOiZRCwqYuBLlFbTQz4NGW_aJi9PzztDopT66Dyo,2320
15
+ fluxloop-0.1.1.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
16
+ fluxloop-0.1.1.dist-info/top_level.txt,sha256=-whiUKvhn6Y7-TLfqrY7fZ1Cudjk8PnrKe7h7m8cuL4,9
17
+ fluxloop-0.1.1.dist-info/RECORD,,