qtype 0.0.14__tar.gz → 0.0.16__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.
Files changed (127) hide show
  1. {qtype-0.0.14/qtype.egg-info → qtype-0.0.16}/PKG-INFO +1 -1
  2. {qtype-0.0.14 → qtype-0.0.16}/pyproject.toml +1 -1
  3. {qtype-0.0.14 → qtype-0.0.16}/qtype/interpreter/api.py +2 -0
  4. {qtype-0.0.14 → qtype-0.0.16}/qtype/interpreter/steps/llm_inference.py +22 -1
  5. {qtype-0.0.14 → qtype-0.0.16/qtype.egg-info}/PKG-INFO +1 -1
  6. {qtype-0.0.14 → qtype-0.0.16}/LICENSE +0 -0
  7. {qtype-0.0.14 → qtype-0.0.16}/README.md +0 -0
  8. {qtype-0.0.14 → qtype-0.0.16}/qtype/__init__.py +0 -0
  9. {qtype-0.0.14 → qtype-0.0.16}/qtype/application/__init__.py +0 -0
  10. {qtype-0.0.14 → qtype-0.0.16}/qtype/application/commons/__init__.py +0 -0
  11. {qtype-0.0.14 → qtype-0.0.16}/qtype/application/commons/tools.py +0 -0
  12. {qtype-0.0.14 → qtype-0.0.16}/qtype/application/converters/__init__.py +0 -0
  13. {qtype-0.0.14 → qtype-0.0.16}/qtype/application/converters/tools_from_api.py +0 -0
  14. {qtype-0.0.14 → qtype-0.0.16}/qtype/application/converters/tools_from_module.py +0 -0
  15. {qtype-0.0.14 → qtype-0.0.16}/qtype/application/converters/types.py +0 -0
  16. {qtype-0.0.14 → qtype-0.0.16}/qtype/application/documentation.py +0 -0
  17. {qtype-0.0.14 → qtype-0.0.16}/qtype/application/facade.py +0 -0
  18. {qtype-0.0.14 → qtype-0.0.16}/qtype/base/__init__.py +0 -0
  19. {qtype-0.0.14 → qtype-0.0.16}/qtype/base/exceptions.py +0 -0
  20. {qtype-0.0.14 → qtype-0.0.16}/qtype/base/logging.py +0 -0
  21. {qtype-0.0.14 → qtype-0.0.16}/qtype/base/types.py +0 -0
  22. {qtype-0.0.14 → qtype-0.0.16}/qtype/cli.py +0 -0
  23. {qtype-0.0.14 → qtype-0.0.16}/qtype/commands/__init__.py +0 -0
  24. {qtype-0.0.14 → qtype-0.0.16}/qtype/commands/convert.py +0 -0
  25. {qtype-0.0.14 → qtype-0.0.16}/qtype/commands/generate.py +0 -0
  26. {qtype-0.0.14 → qtype-0.0.16}/qtype/commands/run.py +0 -0
  27. {qtype-0.0.14 → qtype-0.0.16}/qtype/commands/serve.py +0 -0
  28. {qtype-0.0.14 → qtype-0.0.16}/qtype/commands/validate.py +0 -0
  29. {qtype-0.0.14 → qtype-0.0.16}/qtype/commands/visualize.py +0 -0
  30. {qtype-0.0.14 → qtype-0.0.16}/qtype/dsl/__init__.py +0 -0
  31. {qtype-0.0.14 → qtype-0.0.16}/qtype/dsl/base_types.py +0 -0
  32. {qtype-0.0.14 → qtype-0.0.16}/qtype/dsl/custom_types.py +0 -0
  33. {qtype-0.0.14 → qtype-0.0.16}/qtype/dsl/domain_types.py +0 -0
  34. {qtype-0.0.14 → qtype-0.0.16}/qtype/dsl/model.py +0 -0
  35. {qtype-0.0.14 → qtype-0.0.16}/qtype/dsl/validator.py +0 -0
  36. {qtype-0.0.14 → qtype-0.0.16}/qtype/interpreter/__init__.py +0 -0
  37. {qtype-0.0.14 → qtype-0.0.16}/qtype/interpreter/auth/__init__.py +0 -0
  38. {qtype-0.0.14 → qtype-0.0.16}/qtype/interpreter/auth/aws.py +0 -0
  39. {qtype-0.0.14 → qtype-0.0.16}/qtype/interpreter/auth/cache.py +0 -0
  40. {qtype-0.0.14 → qtype-0.0.16}/qtype/interpreter/auth/generic.py +0 -0
  41. {qtype-0.0.14 → qtype-0.0.16}/qtype/interpreter/batch/__init__.py +0 -0
  42. {qtype-0.0.14 → qtype-0.0.16}/qtype/interpreter/batch/file_sink_source.py +0 -0
  43. {qtype-0.0.14 → qtype-0.0.16}/qtype/interpreter/batch/flow.py +0 -0
  44. {qtype-0.0.14 → qtype-0.0.16}/qtype/interpreter/batch/sql_source.py +0 -0
  45. {qtype-0.0.14 → qtype-0.0.16}/qtype/interpreter/batch/step.py +0 -0
  46. {qtype-0.0.14 → qtype-0.0.16}/qtype/interpreter/batch/types.py +0 -0
  47. {qtype-0.0.14 → qtype-0.0.16}/qtype/interpreter/batch/utils.py +0 -0
  48. {qtype-0.0.14 → qtype-0.0.16}/qtype/interpreter/chat/chat_api.py +0 -0
  49. {qtype-0.0.14 → qtype-0.0.16}/qtype/interpreter/chat/file_conversions.py +0 -0
  50. {qtype-0.0.14 → qtype-0.0.16}/qtype/interpreter/chat/vercel.py +0 -0
  51. {qtype-0.0.14 → qtype-0.0.16}/qtype/interpreter/conversions.py +0 -0
  52. {qtype-0.0.14 → qtype-0.0.16}/qtype/interpreter/exceptions.py +0 -0
  53. {qtype-0.0.14 → qtype-0.0.16}/qtype/interpreter/flow.py +0 -0
  54. {qtype-0.0.14 → qtype-0.0.16}/qtype/interpreter/resource_cache.py +0 -0
  55. {qtype-0.0.14 → qtype-0.0.16}/qtype/interpreter/step.py +0 -0
  56. {qtype-0.0.14 → qtype-0.0.16}/qtype/interpreter/steps/__init__.py +0 -0
  57. {qtype-0.0.14 → qtype-0.0.16}/qtype/interpreter/steps/agent.py +0 -0
  58. {qtype-0.0.14 → qtype-0.0.16}/qtype/interpreter/steps/condition.py +0 -0
  59. {qtype-0.0.14 → qtype-0.0.16}/qtype/interpreter/steps/decoder.py +0 -0
  60. {qtype-0.0.14 → qtype-0.0.16}/qtype/interpreter/steps/prompt_template.py +0 -0
  61. {qtype-0.0.14 → qtype-0.0.16}/qtype/interpreter/steps/search.py +0 -0
  62. {qtype-0.0.14 → qtype-0.0.16}/qtype/interpreter/steps/tool.py +0 -0
  63. {qtype-0.0.14 → qtype-0.0.16}/qtype/interpreter/streaming_helpers.py +0 -0
  64. {qtype-0.0.14 → qtype-0.0.16}/qtype/interpreter/telemetry.py +0 -0
  65. {qtype-0.0.14 → qtype-0.0.16}/qtype/interpreter/typing.py +0 -0
  66. {qtype-0.0.14 → qtype-0.0.16}/qtype/interpreter/ui/404/index.html +0 -0
  67. {qtype-0.0.14 → qtype-0.0.16}/qtype/interpreter/ui/404.html +0 -0
  68. {qtype-0.0.14 → qtype-0.0.16}/qtype/interpreter/ui/_next/static/chunks/393-8fd474427f8e19ce.js +0 -0
  69. {qtype-0.0.14 → qtype-0.0.16}/qtype/interpreter/ui/_next/static/chunks/4bd1b696-cf72ae8a39fa05aa.js +0 -0
  70. {qtype-0.0.14 → qtype-0.0.16}/qtype/interpreter/ui/_next/static/chunks/964-2b041321a01cbf56.js +0 -0
  71. {qtype-0.0.14 → qtype-0.0.16}/qtype/interpreter/ui/_next/static/chunks/app/_not-found/page-e110d2a9d0a83d82.js +0 -0
  72. {qtype-0.0.14 → qtype-0.0.16}/qtype/interpreter/ui/_next/static/chunks/app/layout-a05273ead5de2c41.js +0 -0
  73. {qtype-0.0.14 → qtype-0.0.16}/qtype/interpreter/ui/_next/static/chunks/app/page-7e26b6156cfb55d3.js +0 -0
  74. {qtype-0.0.14 → qtype-0.0.16}/qtype/interpreter/ui/_next/static/chunks/ba12c10f-22556063851a6df2.js +0 -0
  75. {qtype-0.0.14 → qtype-0.0.16}/qtype/interpreter/ui/_next/static/chunks/framework-7c95b8e5103c9e90.js +0 -0
  76. {qtype-0.0.14 → qtype-0.0.16}/qtype/interpreter/ui/_next/static/chunks/main-app-6fc6346bc8f7f163.js +0 -0
  77. {qtype-0.0.14 → qtype-0.0.16}/qtype/interpreter/ui/_next/static/chunks/main-e26b9cb206da2cac.js +0 -0
  78. {qtype-0.0.14 → qtype-0.0.16}/qtype/interpreter/ui/_next/static/chunks/pages/_app-0a0020ddd67f79cf.js +0 -0
  79. {qtype-0.0.14 → qtype-0.0.16}/qtype/interpreter/ui/_next/static/chunks/pages/_error-03529f2c21436739.js +0 -0
  80. {qtype-0.0.14 → qtype-0.0.16}/qtype/interpreter/ui/_next/static/chunks/polyfills-42372ed130431b0a.js +0 -0
  81. {qtype-0.0.14 → qtype-0.0.16}/qtype/interpreter/ui/_next/static/chunks/webpack-08642e441b39b6c2.js +0 -0
  82. {qtype-0.0.14 → qtype-0.0.16}/qtype/interpreter/ui/_next/static/css/b40532b0db09cce3.css +0 -0
  83. {qtype-0.0.14 → qtype-0.0.16}/qtype/interpreter/ui/_next/static/media/4cf2300e9c8272f7-s.p.woff2 +0 -0
  84. {qtype-0.0.14 → qtype-0.0.16}/qtype/interpreter/ui/_next/static/media/747892c23ea88013-s.woff2 +0 -0
  85. {qtype-0.0.14 → qtype-0.0.16}/qtype/interpreter/ui/_next/static/media/8d697b304b401681-s.woff2 +0 -0
  86. {qtype-0.0.14 → qtype-0.0.16}/qtype/interpreter/ui/_next/static/media/93f479601ee12b01-s.p.woff2 +0 -0
  87. {qtype-0.0.14 → qtype-0.0.16}/qtype/interpreter/ui/_next/static/media/9610d9e46709d722-s.woff2 +0 -0
  88. {qtype-0.0.14 → qtype-0.0.16}/qtype/interpreter/ui/_next/static/media/ba015fad6dcf6784-s.woff2 +0 -0
  89. {qtype-0.0.14 → qtype-0.0.16}/qtype/interpreter/ui/_next/static/nUaw6_IwRwPqkzwe5s725/_buildManifest.js +0 -0
  90. {qtype-0.0.14 → qtype-0.0.16}/qtype/interpreter/ui/_next/static/nUaw6_IwRwPqkzwe5s725/_ssgManifest.js +0 -0
  91. {qtype-0.0.14 → qtype-0.0.16}/qtype/interpreter/ui/favicon.ico +0 -0
  92. {qtype-0.0.14 → qtype-0.0.16}/qtype/interpreter/ui/file.svg +0 -0
  93. {qtype-0.0.14 → qtype-0.0.16}/qtype/interpreter/ui/globe.svg +0 -0
  94. {qtype-0.0.14 → qtype-0.0.16}/qtype/interpreter/ui/index.html +0 -0
  95. {qtype-0.0.14 → qtype-0.0.16}/qtype/interpreter/ui/index.txt +0 -0
  96. {qtype-0.0.14 → qtype-0.0.16}/qtype/interpreter/ui/next.svg +0 -0
  97. {qtype-0.0.14 → qtype-0.0.16}/qtype/interpreter/ui/vercel.svg +0 -0
  98. {qtype-0.0.14 → qtype-0.0.16}/qtype/interpreter/ui/window.svg +0 -0
  99. {qtype-0.0.14 → qtype-0.0.16}/qtype/loader.py +0 -0
  100. {qtype-0.0.14 → qtype-0.0.16}/qtype/semantic/__init__.py +0 -0
  101. {qtype-0.0.14 → qtype-0.0.16}/qtype/semantic/base_types.py +0 -0
  102. {qtype-0.0.14 → qtype-0.0.16}/qtype/semantic/generate.py +0 -0
  103. {qtype-0.0.14 → qtype-0.0.16}/qtype/semantic/model.py +0 -0
  104. {qtype-0.0.14 → qtype-0.0.16}/qtype/semantic/resolver.py +0 -0
  105. {qtype-0.0.14 → qtype-0.0.16}/qtype/semantic/visualize.py +0 -0
  106. {qtype-0.0.14 → qtype-0.0.16}/qtype.egg-info/SOURCES.txt +0 -0
  107. {qtype-0.0.14 → qtype-0.0.16}/qtype.egg-info/dependency_links.txt +0 -0
  108. {qtype-0.0.14 → qtype-0.0.16}/qtype.egg-info/entry_points.txt +0 -0
  109. {qtype-0.0.14 → qtype-0.0.16}/qtype.egg-info/requires.txt +0 -0
  110. {qtype-0.0.14 → qtype-0.0.16}/qtype.egg-info/top_level.txt +0 -0
  111. {qtype-0.0.14 → qtype-0.0.16}/setup.cfg +0 -0
  112. {qtype-0.0.14 → qtype-0.0.16}/tests/test_auth_cache.py +0 -0
  113. {qtype-0.0.14 → qtype-0.0.16}/tests/test_aws_auth.py +0 -0
  114. {qtype-0.0.14 → qtype-0.0.16}/tests/test_batch_flow.py +0 -0
  115. {qtype-0.0.14 → qtype-0.0.16}/tests/test_batch_step.py +0 -0
  116. {qtype-0.0.14 → qtype-0.0.16}/tests/test_batch_utils.py +0 -0
  117. {qtype-0.0.14 → qtype-0.0.16}/tests/test_documentation.py +0 -0
  118. {qtype-0.0.14 → qtype-0.0.16}/tests/test_dsl_loader.py +0 -0
  119. {qtype-0.0.14 → qtype-0.0.16}/tests/test_dsl_validation.py +0 -0
  120. {qtype-0.0.14 → qtype-0.0.16}/tests/test_file_sink_source.py +0 -0
  121. {qtype-0.0.14 → qtype-0.0.16}/tests/test_generic_auth.py +0 -0
  122. {qtype-0.0.14 → qtype-0.0.16}/tests/test_list_type.py +0 -0
  123. {qtype-0.0.14 → qtype-0.0.16}/tests/test_semantic_generator.py +0 -0
  124. {qtype-0.0.14 → qtype-0.0.16}/tests/test_semantic_resolver.py +0 -0
  125. {qtype-0.0.14 → qtype-0.0.16}/tests/test_sql_source.py +0 -0
  126. {qtype-0.0.14 → qtype-0.0.16}/tests/test_tools_from_module.py +0 -0
  127. {qtype-0.0.14 → qtype-0.0.16}/tests/test_visualize.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: qtype
3
- Version: 0.0.14
3
+ Version: 0.0.16
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
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "qtype"
3
- version = "0.0.14"
3
+ version = "0.0.16"
4
4
  description = "DSL for Generative AI Prototyping"
5
5
  authors = [{ name="Lou Kratz", email="lou.kratz+qtype@bazaarvoice.com" }]
6
6
  readme = "README.md"
@@ -6,6 +6,7 @@ from pathlib import Path
6
6
  import pandas as pd
7
7
  from fastapi import FastAPI, HTTPException, Query
8
8
  from fastapi.middleware.cors import CORSMiddleware
9
+ from fastapi.responses import RedirectResponse
9
10
  from fastapi.staticfiles import StaticFiles
10
11
 
11
12
  from qtype.dsl.base_types import StepCardinality
@@ -70,6 +71,7 @@ class APIExecutor:
70
71
  StaticFiles(directory=str(ui_dir), html=True),
71
72
  name="ui",
72
73
  )
74
+ app.get("/")(lambda: RedirectResponse(url="/ui"))
73
75
 
74
76
  flows = self.definition.flows if self.definition.flows else []
75
77
 
@@ -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.domain_types import ChatMessage, Embedding
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.14
3
+ Version: 0.0.16
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
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