Skip to content

Commit 54c9f7d

Browse files
committed
👌 IMPROVE: Pipes Type
1 parent efaf8dc commit 54c9f7d

File tree

7 files changed

+251
-237
lines changed

7 files changed

+251
-237
lines changed

CONTRIBUTION.md

Lines changed: 0 additions & 130 deletions
This file was deleted.

examples/agent/agent.run.typed-stream.py

Lines changed: 0 additions & 84 deletions
This file was deleted.

examples/pipes/pipes.create.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,11 @@ def main():
1717
langbase_api_key = os.getenv("LANGBASE_API_KEY")
1818

1919
# Initialize the client
20-
lb = Langbase(api_key=langbase_api_key)
20+
langbase = Langbase(api_key=langbase_api_key)
2121

2222
# Create the pipe
2323
try:
24-
response = lb.pipes.create(
24+
response = langbase.pipes.create(
2525
name="summary-agent",
2626
description="A pipe for text summarization",
2727
messages=[

langbase/__init__.py

Lines changed: 37 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,25 @@
3838
)
3939
from .langbase import Langbase
4040
from .streaming import StreamEventType, TypedStreamProcessor
41+
from .types import (
42+
ChoiceGenerate,
43+
Message,
44+
PipeBaseOptions,
45+
PipeBaseResponse,
46+
PipeCreateOptions,
47+
PipeCreateResponse,
48+
PipeListResponse,
49+
PipeUpdateOptions,
50+
PipeUpdateResponse,
51+
ResponseFormat,
52+
RunResponse,
53+
RunResponseStream,
54+
ToolCall,
55+
ToolChoice,
56+
Tools,
57+
Usage,
58+
Variable,
59+
)
4160
from .workflow import TimeoutError, Workflow
4261

4362
__version__ = "0.1.0"
@@ -61,10 +80,26 @@
6180
"RateLimitError",
6281
"TimeoutError",
6382
"UnprocessableEntityError",
83+
# Type definitions
84+
"ChoiceGenerate",
85+
"Message",
86+
"PipeBaseOptions",
87+
"PipeBaseResponse",
88+
"PipeCreateOptions",
89+
"PipeCreateResponse",
90+
"PipeListResponse",
91+
"PipeUpdateOptions",
92+
"PipeUpdateResponse",
93+
"ResponseFormat",
94+
"RunResponse",
95+
"RunResponseStream",
96+
"ToolCall",
97+
"ToolChoice",
98+
"Tools",
99+
"Usage",
100+
"Variable",
64101
# Helper utilities
65-
"ChoiceStream",
66102
"ChunkStream",
67-
"Delta",
68103
"StreamProcessor",
69104
"collect_stream_text",
70105
"create_stream_processor",

0 commit comments

Comments
 (0)