qtype 0.0.13__py3-none-any.whl → 0.0.15__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.
- qtype/interpreter/steps/llm_inference.py +22 -1
- {qtype-0.0.13.dist-info → qtype-0.0.15.dist-info}/METADATA +2 -1
- {qtype-0.0.13.dist-info → qtype-0.0.15.dist-info}/RECORD +7 -7
- {qtype-0.0.13.dist-info → qtype-0.0.15.dist-info}/WHEEL +0 -0
- {qtype-0.0.13.dist-info → qtype-0.0.15.dist-info}/entry_points.txt +0 -0
- {qtype-0.0.13.dist-info → qtype-0.0.15.dist-info}/licenses/LICENSE +0 -0
- {qtype-0.0.13.dist-info → qtype-0.0.15.dist-info}/top_level.txt +0 -0
|
@@ -1,9 +1,16 @@
|
|
|
1
1
|
import logging
|
|
2
2
|
from typing import Any, Callable
|
|
3
3
|
|
|
4
|
+
from llama_cloud import MessageRole as LlamaMessageRole
|
|
4
5
|
from llama_index.core.base.llms.types import ChatResponse, CompletionResponse
|
|
5
6
|
|
|
6
|
-
from qtype.dsl.
|
|
7
|
+
from qtype.dsl.base_types import PrimitiveTypeEnum
|
|
8
|
+
from qtype.dsl.domain_types import (
|
|
9
|
+
ChatContent,
|
|
10
|
+
ChatMessage,
|
|
11
|
+
Embedding,
|
|
12
|
+
MessageRole,
|
|
13
|
+
)
|
|
7
14
|
from qtype.interpreter.conversions import (
|
|
8
15
|
from_chat_message,
|
|
9
16
|
to_chat_message,
|
|
@@ -96,6 +103,20 @@ def execute(
|
|
|
96
103
|
history: list[ChatMessage] = conversation_history
|
|
97
104
|
inputs = [to_chat_message(msg) for msg in history] + inputs
|
|
98
105
|
|
|
106
|
+
if li.system_message and inputs[0].role != LlamaMessageRole.SYSTEM:
|
|
107
|
+
# There is a system prompt we should append
|
|
108
|
+
# Note system_prompt on the llm doesn't work for chat -- is only used for predict https://github.com/run-llama/llama_index/issues/13983
|
|
109
|
+
system_message = ChatMessage(
|
|
110
|
+
role=MessageRole.system,
|
|
111
|
+
blocks=[
|
|
112
|
+
ChatContent(
|
|
113
|
+
type=PrimitiveTypeEnum.text,
|
|
114
|
+
content=li.system_message,
|
|
115
|
+
)
|
|
116
|
+
],
|
|
117
|
+
)
|
|
118
|
+
inputs = [to_chat_message(system_message)] + inputs
|
|
119
|
+
|
|
99
120
|
# If the stream function is set, we'll stream the results
|
|
100
121
|
chat_result: ChatResponse
|
|
101
122
|
if stream_fn:
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: qtype
|
|
3
|
-
Version: 0.0.
|
|
3
|
+
Version: 0.0.15
|
|
4
4
|
Summary: DSL for Generative AI Prototyping
|
|
5
5
|
Author-email: Lou Kratz <lou.kratz+qtype@bazaarvoice.com>
|
|
6
6
|
License-Expression: Apache-2.0
|
|
@@ -31,6 +31,7 @@ Requires-Dist: llama-index>=0.12.45; extra == "interpreter"
|
|
|
31
31
|
Requires-Dist: openinference-instrumentation-llama-index>=4.3.4; extra == "interpreter"
|
|
32
32
|
Requires-Dist: pandas>=2.2.3; extra == "interpreter"
|
|
33
33
|
Requires-Dist: psycopg2-binary>=2.9.10; extra == "interpreter"
|
|
34
|
+
Requires-Dist: pyarrow>=21.0.0; extra == "interpreter"
|
|
34
35
|
Requires-Dist: pyathena[sqlalchemy]>=3.18.0; extra == "interpreter"
|
|
35
36
|
Requires-Dist: python-magic>=0.4.27; extra == "interpreter"
|
|
36
37
|
Requires-Dist: s3fs>=2025.7.0; extra == "interpreter"
|
|
@@ -55,7 +55,7 @@ qtype/interpreter/steps/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG
|
|
|
55
55
|
qtype/interpreter/steps/agent.py,sha256=Yg56YjTlrwc4oJ-f7ZBazF4ii2oJX8zMhETHF0-ArAU,4008
|
|
56
56
|
qtype/interpreter/steps/condition.py,sha256=E86aRWQpjz18QuKwcGyoIPoOKAvTDZgnpg9qXw6xYas,1128
|
|
57
57
|
qtype/interpreter/steps/decoder.py,sha256=toKiZHpM3_y6imV8xQXmAOvGGFhqJzXaWlM1HLIyOzw,2993
|
|
58
|
-
qtype/interpreter/steps/llm_inference.py,sha256=
|
|
58
|
+
qtype/interpreter/steps/llm_inference.py,sha256=jnRqcTx7yIbJ5Sbi1hjeJUGBw9eOHwgUhe-f-XmngyI,6218
|
|
59
59
|
qtype/interpreter/steps/prompt_template.py,sha256=tK1j6DTUMvlDMcJZDGQ2lLgwq_LkaICIq0U5u-QK_WU,1597
|
|
60
60
|
qtype/interpreter/steps/search.py,sha256=wyVFwg5wVXytsm2JyNPwkuBAWpxEunP-dAiqhDZyii4,660
|
|
61
61
|
qtype/interpreter/steps/tool.py,sha256=SNY1SOTpydwo-P-zf1w2EU9tFkXy9YrfjdI9AP2Kbe8,7276
|
|
@@ -98,9 +98,9 @@ qtype/semantic/generate.py,sha256=c7yzVmzNyOqWdlbofR1FY8QyeiLYddnIdSsd6VvyY0c,15
|
|
|
98
98
|
qtype/semantic/model.py,sha256=HoG6rawJ7UuaDbME9QgQke8lOJYUNdawZBBZucNxPbc,16582
|
|
99
99
|
qtype/semantic/resolver.py,sha256=rhePhY1m4h-qYZucIcBcu0DMocjlOs5OVSbhR5HZ2xo,3404
|
|
100
100
|
qtype/semantic/visualize.py,sha256=ZFXBBxqRkX9vXNoCQAReYU7HB3Ecmsm5sQBMEox8ZNU,17444
|
|
101
|
-
qtype-0.0.
|
|
102
|
-
qtype-0.0.
|
|
103
|
-
qtype-0.0.
|
|
104
|
-
qtype-0.0.
|
|
105
|
-
qtype-0.0.
|
|
106
|
-
qtype-0.0.
|
|
101
|
+
qtype-0.0.15.dist-info/licenses/LICENSE,sha256=1KA5EgYBSR0O6nCH2HEvk6Di53YKJ9r_VCR7G8G8qAY,11341
|
|
102
|
+
qtype-0.0.15.dist-info/METADATA,sha256=2nUkDNkw1mBudY2dtHV7mGP7WAk8I85u1mmJG8jGZEM,4737
|
|
103
|
+
qtype-0.0.15.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
104
|
+
qtype-0.0.15.dist-info/entry_points.txt,sha256=5y4vj8RLvgl2tXSj-Hm7v5-Tn3kP4-UonjNoN-mfaQE,41
|
|
105
|
+
qtype-0.0.15.dist-info/top_level.txt,sha256=ONroH5B0mZ51jr7NSWCK0weFwwCO7wBLmyVS1YqNU14,6
|
|
106
|
+
qtype-0.0.15.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|