latitude-sdk 1.1.0__tar.gz → 1.1.1__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.
- {latitude_sdk-1.1.0 → latitude_sdk-1.1.1}/PKG-INFO +2 -2
- {latitude_sdk-1.1.0 → latitude_sdk-1.1.1}/pyproject.toml +2 -2
- {latitude_sdk-1.1.0 → latitude_sdk-1.1.1}/tests/prompts/render_test.py +66 -2
- {latitude_sdk-1.1.0 → latitude_sdk-1.1.1}/uv.lock +6 -5
- {latitude_sdk-1.1.0 → latitude_sdk-1.1.1}/.gitignore +0 -0
- {latitude_sdk-1.1.0 → latitude_sdk-1.1.1}/.python-version +0 -0
- {latitude_sdk-1.1.0 → latitude_sdk-1.1.1}/README.md +0 -0
- {latitude_sdk-1.1.0 → latitude_sdk-1.1.1}/scripts/format.py +0 -0
- {latitude_sdk-1.1.0 → latitude_sdk-1.1.1}/scripts/lint.py +0 -0
- {latitude_sdk-1.1.0 → latitude_sdk-1.1.1}/scripts/test.py +0 -0
- {latitude_sdk-1.1.0 → latitude_sdk-1.1.1}/src/latitude_sdk/__init__.py +0 -0
- {latitude_sdk-1.1.0 → latitude_sdk-1.1.1}/src/latitude_sdk/client/__init__.py +0 -0
- {latitude_sdk-1.1.0 → latitude_sdk-1.1.1}/src/latitude_sdk/client/client.py +0 -0
- {latitude_sdk-1.1.0 → latitude_sdk-1.1.1}/src/latitude_sdk/client/payloads.py +0 -0
- {latitude_sdk-1.1.0 → latitude_sdk-1.1.1}/src/latitude_sdk/client/router.py +0 -0
- {latitude_sdk-1.1.0 → latitude_sdk-1.1.1}/src/latitude_sdk/env/__init__.py +0 -0
- {latitude_sdk-1.1.0 → latitude_sdk-1.1.1}/src/latitude_sdk/env/env.py +0 -0
- {latitude_sdk-1.1.0 → latitude_sdk-1.1.1}/src/latitude_sdk/py.typed +0 -0
- {latitude_sdk-1.1.0 → latitude_sdk-1.1.1}/src/latitude_sdk/sdk/__init__.py +0 -0
- {latitude_sdk-1.1.0 → latitude_sdk-1.1.1}/src/latitude_sdk/sdk/errors.py +0 -0
- {latitude_sdk-1.1.0 → latitude_sdk-1.1.1}/src/latitude_sdk/sdk/evaluations.py +0 -0
- {latitude_sdk-1.1.0 → latitude_sdk-1.1.1}/src/latitude_sdk/sdk/latitude.py +0 -0
- {latitude_sdk-1.1.0 → latitude_sdk-1.1.1}/src/latitude_sdk/sdk/logs.py +0 -0
- {latitude_sdk-1.1.0 → latitude_sdk-1.1.1}/src/latitude_sdk/sdk/prompts.py +0 -0
- {latitude_sdk-1.1.0 → latitude_sdk-1.1.1}/src/latitude_sdk/sdk/types.py +0 -0
- {latitude_sdk-1.1.0 → latitude_sdk-1.1.1}/src/latitude_sdk/util/__init__.py +0 -0
- {latitude_sdk-1.1.0 → latitude_sdk-1.1.1}/src/latitude_sdk/util/utils.py +0 -0
- {latitude_sdk-1.1.0 → latitude_sdk-1.1.1}/tests/__init__.py +0 -0
- {latitude_sdk-1.1.0 → latitude_sdk-1.1.1}/tests/evaluations/__init__.py +0 -0
- {latitude_sdk-1.1.0 → latitude_sdk-1.1.1}/tests/evaluations/create_result_test.py +0 -0
- {latitude_sdk-1.1.0 → latitude_sdk-1.1.1}/tests/evaluations/trigger_test.py +0 -0
- {latitude_sdk-1.1.0 → latitude_sdk-1.1.1}/tests/logs/__init__.py +0 -0
- {latitude_sdk-1.1.0 → latitude_sdk-1.1.1}/tests/logs/create_test.py +0 -0
- {latitude_sdk-1.1.0 → latitude_sdk-1.1.1}/tests/prompts/__init__.py +0 -0
- {latitude_sdk-1.1.0 → latitude_sdk-1.1.1}/tests/prompts/chat_test.py +0 -0
- {latitude_sdk-1.1.0 → latitude_sdk-1.1.1}/tests/prompts/get_all_test.py +0 -0
- {latitude_sdk-1.1.0 → latitude_sdk-1.1.1}/tests/prompts/get_or_create_test.py +0 -0
- {latitude_sdk-1.1.0 → latitude_sdk-1.1.1}/tests/prompts/get_test.py +0 -0
- {latitude_sdk-1.1.0 → latitude_sdk-1.1.1}/tests/prompts/render_chain_test.py +0 -0
- {latitude_sdk-1.1.0 → latitude_sdk-1.1.1}/tests/prompts/run_test.py +0 -0
- {latitude_sdk-1.1.0 → latitude_sdk-1.1.1}/tests/utils/__init__.py +0 -0
- {latitude_sdk-1.1.0 → latitude_sdk-1.1.1}/tests/utils/fixtures.py +0 -0
- {latitude_sdk-1.1.0 → latitude_sdk-1.1.1}/tests/utils/utils.py +0 -0
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.4
|
2
2
|
Name: latitude-sdk
|
3
|
-
Version: 1.1.
|
3
|
+
Version: 1.1.1
|
4
4
|
Summary: Latitude SDK for Python
|
5
5
|
Project-URL: repository, https://github.com/latitude-dev/latitude-llm/tree/main/packages/sdks/python
|
6
6
|
Project-URL: homepage, https://github.com/latitude-dev/latitude-llm/tree/main/packages/sdks/python#readme
|
@@ -12,7 +12,7 @@ Requires-Python: <3.13,>=3.9
|
|
12
12
|
Requires-Dist: httpx-sse>=0.4.0
|
13
13
|
Requires-Dist: httpx>=0.28.1
|
14
14
|
Requires-Dist: latitude-telemetry>=1.0.0
|
15
|
-
Requires-Dist: promptl-ai>=1.0.
|
15
|
+
Requires-Dist: promptl-ai>=1.0.3
|
16
16
|
Requires-Dist: pydantic>=2.10.3
|
17
17
|
Requires-Dist: typing-extensions>=4.12.2
|
18
18
|
Description-Content-Type: text/markdown
|
@@ -1,6 +1,6 @@
|
|
1
1
|
[project]
|
2
2
|
name = "latitude-sdk"
|
3
|
-
version = "1.1.
|
3
|
+
version = "1.1.1"
|
4
4
|
description = "Latitude SDK for Python"
|
5
5
|
authors = [{ name = "Latitude Data SL", email = "hello@latitude.so" }]
|
6
6
|
maintainers = [{ name = "Latitude Data SL", email = "hello@latitude.so" }]
|
@@ -16,7 +16,7 @@ dependencies = [
|
|
16
16
|
"pydantic>=2.10.3",
|
17
17
|
"typing-extensions>=4.12.2",
|
18
18
|
"latitude-telemetry>=1.0.0",
|
19
|
-
"promptl-ai>=1.0.
|
19
|
+
"promptl-ai>=1.0.3",
|
20
20
|
]
|
21
21
|
|
22
22
|
[dependency-groups]
|
@@ -1,6 +1,16 @@
|
|
1
1
|
from unittest import mock
|
2
2
|
|
3
|
-
from promptl_ai import
|
3
|
+
from promptl_ai import (
|
4
|
+
Adapter,
|
5
|
+
Error,
|
6
|
+
ErrorPosition,
|
7
|
+
PromptlError,
|
8
|
+
SystemMessage,
|
9
|
+
TextContent,
|
10
|
+
UserMessage,
|
11
|
+
anthropic,
|
12
|
+
openai,
|
13
|
+
)
|
4
14
|
|
5
15
|
from latitude_sdk import RenderPromptOptions, RenderPromptResult
|
6
16
|
from tests.utils import TestCase, fixtures
|
@@ -33,7 +43,7 @@ class TestRenderPrompt(TestCase):
|
|
33
43
|
),
|
34
44
|
)
|
35
45
|
|
36
|
-
async def
|
46
|
+
async def test_success_with_adapter_singlepart(self):
|
37
47
|
prompt = fixtures.PROMPT.content
|
38
48
|
options = RenderPromptOptions(
|
39
49
|
parameters={"question": "What is PromptL"},
|
@@ -59,6 +69,60 @@ class TestRenderPrompt(TestCase):
|
|
59
69
|
),
|
60
70
|
)
|
61
71
|
|
72
|
+
async def test_success_with_adapter_multipart(self):
|
73
|
+
parts = fixtures.PROMPT.content.split("</step>")
|
74
|
+
prompt = "</step>".join(
|
75
|
+
[
|
76
|
+
parts[0]
|
77
|
+
+ """
|
78
|
+
<user>
|
79
|
+
This is text.
|
80
|
+
<content-image>This is an image.</content-image>
|
81
|
+
<content-file mime="application/pdf">This is a PDF.</content-file>
|
82
|
+
</user>
|
83
|
+
""",
|
84
|
+
*parts[1:],
|
85
|
+
]
|
86
|
+
)
|
87
|
+
options = RenderPromptOptions(
|
88
|
+
parameters={"question": "What is PromptL"},
|
89
|
+
adapter=Adapter.Anthropic,
|
90
|
+
)
|
91
|
+
|
92
|
+
result = await self.sdk.prompts.render(prompt, options)
|
93
|
+
|
94
|
+
self.assertEqual(
|
95
|
+
result,
|
96
|
+
RenderPromptResult(
|
97
|
+
messages=[
|
98
|
+
anthropic.UserMessage(content=[anthropic.TextContent(text="What is PromptL")]),
|
99
|
+
anthropic.UserMessage(
|
100
|
+
content=[
|
101
|
+
anthropic.TextContent(text="This is text."),
|
102
|
+
anthropic.ImageContent(
|
103
|
+
source=anthropic.ContentSource(
|
104
|
+
type="base64", media_type="image/png", data="This is an image."
|
105
|
+
)
|
106
|
+
),
|
107
|
+
anthropic.DocumentContent(
|
108
|
+
source=anthropic.ContentSource(
|
109
|
+
type="base64", media_type="application/pdf", data="This is a PDF."
|
110
|
+
)
|
111
|
+
),
|
112
|
+
]
|
113
|
+
),
|
114
|
+
],
|
115
|
+
config={
|
116
|
+
"provider": "OpenAI",
|
117
|
+
"model": "gpt-4o-mini",
|
118
|
+
"temperature": 0.5,
|
119
|
+
"max_tokens": 1024,
|
120
|
+
"top_p": 0.9,
|
121
|
+
"system": [{"type": "text", "text": "You are a helpful assistant."}],
|
122
|
+
},
|
123
|
+
),
|
124
|
+
)
|
125
|
+
|
62
126
|
async def test_fails(self):
|
63
127
|
prompt = fixtures.PROMPT.content
|
64
128
|
options = RenderPromptOptions(
|
@@ -1,4 +1,5 @@
|
|
1
1
|
version = 1
|
2
|
+
revision = 1
|
2
3
|
requires-python = ">=3.9, <3.13"
|
3
4
|
|
4
5
|
[[package]]
|
@@ -316,7 +317,7 @@ wheels = [
|
|
316
317
|
|
317
318
|
[[package]]
|
318
319
|
name = "latitude-sdk"
|
319
|
-
version = "1.1.
|
320
|
+
version = "1.1.1"
|
320
321
|
source = { editable = "." }
|
321
322
|
dependencies = [
|
322
323
|
{ name = "httpx" },
|
@@ -343,7 +344,7 @@ requires-dist = [
|
|
343
344
|
{ name = "httpx", specifier = ">=0.28.1" },
|
344
345
|
{ name = "httpx-sse", specifier = ">=0.4.0" },
|
345
346
|
{ name = "latitude-telemetry", specifier = ">=1.0.0" },
|
346
|
-
{ name = "promptl-ai", specifier = ">=1.0.
|
347
|
+
{ name = "promptl-ai", specifier = ">=1.0.3" },
|
347
348
|
{ name = "pydantic", specifier = ">=2.10.3" },
|
348
349
|
{ name = "typing-extensions", specifier = ">=4.12.2" },
|
349
350
|
]
|
@@ -837,16 +838,16 @@ wheels = [
|
|
837
838
|
|
838
839
|
[[package]]
|
839
840
|
name = "promptl-ai"
|
840
|
-
version = "1.0.
|
841
|
+
version = "1.0.3"
|
841
842
|
source = { registry = "https://pypi.org/simple" }
|
842
843
|
dependencies = [
|
843
844
|
{ name = "pydantic" },
|
844
845
|
{ name = "typing-extensions" },
|
845
846
|
{ name = "wasmtime" },
|
846
847
|
]
|
847
|
-
sdist = { url = "https://files.pythonhosted.org/packages/
|
848
|
+
sdist = { url = "https://files.pythonhosted.org/packages/b0/42/cfac426457eeb7a765e0bb5edcab7a294a611ce5ca4a9d7ff25a57723aaf/promptl_ai-1.0.3.tar.gz", hash = "sha256:fe14dd5248878f1842ce30caa62d67182cfc6f3229a54fbad0709571e6c8694f", size = 981242 }
|
848
849
|
wheels = [
|
849
|
-
{ url = "https://files.pythonhosted.org/packages/
|
850
|
+
{ url = "https://files.pythonhosted.org/packages/81/e4/b1889c70ec8f0050cb67f28d4b01c6e38656340acf65d2c9460ea19dd3e0/promptl_ai-1.0.3-py3-none-any.whl", hash = "sha256:30e589459feae16d69eaa2485429413268d9c7e3c1d03ac1195a9d54f6139793", size = 966250 },
|
850
851
|
]
|
851
852
|
|
852
853
|
[[package]]
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|