tracia 0.0.1__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.
tracia/__init__.py CHANGED
@@ -1,8 +1,157 @@
1
1
  """
2
2
  Tracia - LLM prompt management and tracing SDK
3
3
 
4
- Full SDK coming soon at https://tracia.io
4
+ A Python SDK for managing LLM prompts and tracing LLM interactions.
5
+ Uses LiteLLM as the unified provider abstraction layer.
6
+
7
+ Example usage:
8
+ ```python
9
+ from tracia import Tracia
10
+
11
+ client = Tracia(api_key="your_api_key")
12
+
13
+ # Run a local prompt
14
+ result = client.run_local(
15
+ model="gpt-4o",
16
+ messages=[{"role": "user", "content": "Hello!"}]
17
+ )
18
+ print(result.text)
19
+
20
+ # Run with streaming
21
+ stream = client.run_local(
22
+ model="gpt-4o",
23
+ messages=[{"role": "user", "content": "Tell me a story"}],
24
+ stream=True
25
+ )
26
+ for chunk in stream:
27
+ print(chunk, end="")
28
+
29
+ # Use prompts API
30
+ prompts = client.prompts.list()
31
+ prompt = client.prompts.get("my-prompt")
32
+
33
+ # Use spans API
34
+ spans = client.spans.list()
35
+ client.spans.evaluate("sp_xxx", EvaluateOptions(evaluator="quality", value=1))
36
+
37
+ # Create a session for multi-turn conversations
38
+ session = client.create_session()
39
+ r1 = session.run_local(model="gpt-4o", messages=[...])
40
+ r2 = session.run_local(model="gpt-4o", messages=[...]) # Linked
41
+
42
+ # Clean up
43
+ client.close()
44
+ ```
5
45
  """
6
46
 
7
- __version__ = "0.0.1"
8
- __status__ = "coming-soon"
47
+ from ._client import Tracia
48
+ from ._constants import SDK_VERSION, Eval
49
+ from ._errors import TraciaError, TraciaErrorCode
50
+ from ._session import TraciaSession
51
+ from ._streaming import AsyncLocalStream, LocalStream
52
+ from ._types import (
53
+ ContentPart,
54
+ CreatePromptOptions,
55
+ CreateSpanPayload,
56
+ CreateSpanResult,
57
+ EvaluateOptions,
58
+ EvaluateResult,
59
+ FinishReason,
60
+ JsonSchemaProperty,
61
+ ListSpansOptions,
62
+ ListSpansResult,
63
+ LLMProvider,
64
+ LocalPromptMessage,
65
+ Prompt,
66
+ PromptListItem,
67
+ PromptMessage,
68
+ PromptVersion,
69
+ ResponsesEvent,
70
+ ResponsesFunctionCall,
71
+ ResponsesFunctionCallOutput,
72
+ ResponsesInputItem,
73
+ ResponsesInputMessage,
74
+ ResponsesMessage,
75
+ ResponsesOutputItem,
76
+ ResponsesToolCall,
77
+ RunLocalInput,
78
+ RunLocalResult,
79
+ RunOptions,
80
+ RunResponsesInput,
81
+ RunResponsesResult,
82
+ RunResult,
83
+ Span,
84
+ SpanListItem,
85
+ StreamResult,
86
+ TextPart,
87
+ TokenUsage,
88
+ ToolCall,
89
+ ToolCallPart,
90
+ ToolChoice,
91
+ ToolDefinition,
92
+ ToolParameters,
93
+ UpdatePromptOptions,
94
+ )
95
+
96
+ __version__ = SDK_VERSION
97
+ __all__ = [
98
+ # Main client
99
+ "Tracia",
100
+ "TraciaSession",
101
+ # Errors
102
+ "TraciaError",
103
+ "TraciaErrorCode",
104
+ # Constants
105
+ "Eval",
106
+ # Streaming
107
+ "LocalStream",
108
+ "AsyncLocalStream",
109
+ # Types - Core
110
+ "LLMProvider",
111
+ "TokenUsage",
112
+ "FinishReason",
113
+ # Types - Messages
114
+ "LocalPromptMessage",
115
+ "ContentPart",
116
+ "TextPart",
117
+ "ToolCallPart",
118
+ # Types - Tools
119
+ "ToolDefinition",
120
+ "ToolParameters",
121
+ "JsonSchemaProperty",
122
+ "ToolCall",
123
+ "ToolChoice",
124
+ # Types - Run Local
125
+ "RunLocalInput",
126
+ "RunLocalResult",
127
+ "StreamResult",
128
+ # Types - Run Responses (OpenAI Responses API)
129
+ "RunResponsesInput",
130
+ "RunResponsesResult",
131
+ "ResponsesInputItem",
132
+ "ResponsesInputMessage",
133
+ "ResponsesFunctionCallOutput",
134
+ "ResponsesFunctionCall",
135
+ "ResponsesMessage",
136
+ "ResponsesOutputItem",
137
+ "ResponsesToolCall",
138
+ "ResponsesEvent",
139
+ # Types - Spans
140
+ "CreateSpanPayload",
141
+ "CreateSpanResult",
142
+ "Span",
143
+ "SpanListItem",
144
+ "ListSpansOptions",
145
+ "ListSpansResult",
146
+ "EvaluateOptions",
147
+ "EvaluateResult",
148
+ # Types - Prompts
149
+ "Prompt",
150
+ "PromptListItem",
151
+ "PromptMessage",
152
+ "PromptVersion",
153
+ "CreatePromptOptions",
154
+ "UpdatePromptOptions",
155
+ "RunOptions",
156
+ "RunResult",
157
+ ]