qtype 0.1.5__tar.gz → 0.1.6__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 (142) hide show
  1. {qtype-0.1.5/qtype.egg-info → qtype-0.1.6}/PKG-INFO +1 -1
  2. {qtype-0.1.5 → qtype-0.1.6}/pyproject.toml +1 -1
  3. {qtype-0.1.5 → qtype-0.1.6}/qtype/interpreter/executors/document_embedder_executor.py +12 -1
  4. {qtype-0.1.5 → qtype-0.1.6}/qtype/interpreter/executors/invoke_embedding_executor.py +33 -23
  5. {qtype-0.1.5 → qtype-0.1.6/qtype.egg-info}/PKG-INFO +1 -1
  6. {qtype-0.1.5 → qtype-0.1.6}/LICENSE +0 -0
  7. {qtype-0.1.5 → qtype-0.1.6}/README.md +0 -0
  8. {qtype-0.1.5 → qtype-0.1.6}/qtype/__init__.py +0 -0
  9. {qtype-0.1.5 → qtype-0.1.6}/qtype/application/__init__.py +0 -0
  10. {qtype-0.1.5 → qtype-0.1.6}/qtype/application/commons/__init__.py +0 -0
  11. {qtype-0.1.5 → qtype-0.1.6}/qtype/application/commons/tools.py +0 -0
  12. {qtype-0.1.5 → qtype-0.1.6}/qtype/application/converters/__init__.py +0 -0
  13. {qtype-0.1.5 → qtype-0.1.6}/qtype/application/converters/tools_from_api.py +0 -0
  14. {qtype-0.1.5 → qtype-0.1.6}/qtype/application/converters/tools_from_module.py +0 -0
  15. {qtype-0.1.5 → qtype-0.1.6}/qtype/application/converters/types.py +0 -0
  16. {qtype-0.1.5 → qtype-0.1.6}/qtype/application/documentation.py +0 -0
  17. {qtype-0.1.5 → qtype-0.1.6}/qtype/application/facade.py +0 -0
  18. {qtype-0.1.5 → qtype-0.1.6}/qtype/base/__init__.py +0 -0
  19. {qtype-0.1.5 → qtype-0.1.6}/qtype/base/exceptions.py +0 -0
  20. {qtype-0.1.5 → qtype-0.1.6}/qtype/base/logging.py +0 -0
  21. {qtype-0.1.5 → qtype-0.1.6}/qtype/base/types.py +0 -0
  22. {qtype-0.1.5 → qtype-0.1.6}/qtype/cli.py +0 -0
  23. {qtype-0.1.5 → qtype-0.1.6}/qtype/commands/__init__.py +0 -0
  24. {qtype-0.1.5 → qtype-0.1.6}/qtype/commands/convert.py +0 -0
  25. {qtype-0.1.5 → qtype-0.1.6}/qtype/commands/generate.py +0 -0
  26. {qtype-0.1.5 → qtype-0.1.6}/qtype/commands/run.py +0 -0
  27. {qtype-0.1.5 → qtype-0.1.6}/qtype/commands/serve.py +0 -0
  28. {qtype-0.1.5 → qtype-0.1.6}/qtype/commands/validate.py +0 -0
  29. {qtype-0.1.5 → qtype-0.1.6}/qtype/commands/visualize.py +0 -0
  30. {qtype-0.1.5 → qtype-0.1.6}/qtype/dsl/__init__.py +0 -0
  31. {qtype-0.1.5 → qtype-0.1.6}/qtype/dsl/custom_types.py +0 -0
  32. {qtype-0.1.5 → qtype-0.1.6}/qtype/dsl/domain_types.py +0 -0
  33. {qtype-0.1.5 → qtype-0.1.6}/qtype/dsl/linker.py +0 -0
  34. {qtype-0.1.5 → qtype-0.1.6}/qtype/dsl/loader.py +0 -0
  35. {qtype-0.1.5 → qtype-0.1.6}/qtype/dsl/model.py +0 -0
  36. {qtype-0.1.5 → qtype-0.1.6}/qtype/dsl/parser.py +0 -0
  37. {qtype-0.1.5 → qtype-0.1.6}/qtype/dsl/types.py +0 -0
  38. {qtype-0.1.5 → qtype-0.1.6}/qtype/interpreter/__init__.py +0 -0
  39. {qtype-0.1.5 → qtype-0.1.6}/qtype/interpreter/api.py +0 -0
  40. {qtype-0.1.5 → qtype-0.1.6}/qtype/interpreter/auth/__init__.py +0 -0
  41. {qtype-0.1.5 → qtype-0.1.6}/qtype/interpreter/auth/aws.py +0 -0
  42. {qtype-0.1.5 → qtype-0.1.6}/qtype/interpreter/auth/cache.py +0 -0
  43. {qtype-0.1.5 → qtype-0.1.6}/qtype/interpreter/auth/generic.py +0 -0
  44. {qtype-0.1.5 → qtype-0.1.6}/qtype/interpreter/base/base_step_executor.py +0 -0
  45. {qtype-0.1.5 → qtype-0.1.6}/qtype/interpreter/base/batch_step_executor.py +0 -0
  46. {qtype-0.1.5 → qtype-0.1.6}/qtype/interpreter/base/exceptions.py +0 -0
  47. {qtype-0.1.5 → qtype-0.1.6}/qtype/interpreter/base/executor_context.py +0 -0
  48. {qtype-0.1.5 → qtype-0.1.6}/qtype/interpreter/base/factory.py +0 -0
  49. {qtype-0.1.5 → qtype-0.1.6}/qtype/interpreter/base/progress_tracker.py +0 -0
  50. {qtype-0.1.5 → qtype-0.1.6}/qtype/interpreter/base/secrets.py +0 -0
  51. {qtype-0.1.5 → qtype-0.1.6}/qtype/interpreter/base/step_cache.py +0 -0
  52. {qtype-0.1.5 → qtype-0.1.6}/qtype/interpreter/base/stream_emitter.py +0 -0
  53. {qtype-0.1.5 → qtype-0.1.6}/qtype/interpreter/conversions.py +0 -0
  54. {qtype-0.1.5 → qtype-0.1.6}/qtype/interpreter/converters.py +0 -0
  55. {qtype-0.1.5 → qtype-0.1.6}/qtype/interpreter/endpoints.py +0 -0
  56. {qtype-0.1.5 → qtype-0.1.6}/qtype/interpreter/executors/agent_executor.py +0 -0
  57. {qtype-0.1.5 → qtype-0.1.6}/qtype/interpreter/executors/aggregate_executor.py +0 -0
  58. {qtype-0.1.5 → qtype-0.1.6}/qtype/interpreter/executors/bedrock_reranker_executor.py +0 -0
  59. {qtype-0.1.5 → qtype-0.1.6}/qtype/interpreter/executors/decoder_executor.py +0 -0
  60. {qtype-0.1.5 → qtype-0.1.6}/qtype/interpreter/executors/doc_to_text_executor.py +0 -0
  61. {qtype-0.1.5 → qtype-0.1.6}/qtype/interpreter/executors/document_search_executor.py +0 -0
  62. {qtype-0.1.5 → qtype-0.1.6}/qtype/interpreter/executors/document_source_executor.py +0 -0
  63. {qtype-0.1.5 → qtype-0.1.6}/qtype/interpreter/executors/document_splitter_executor.py +0 -0
  64. {qtype-0.1.5 → qtype-0.1.6}/qtype/interpreter/executors/echo_executor.py +0 -0
  65. {qtype-0.1.5 → qtype-0.1.6}/qtype/interpreter/executors/field_extractor_executor.py +0 -0
  66. {qtype-0.1.5 → qtype-0.1.6}/qtype/interpreter/executors/file_source_executor.py +0 -0
  67. {qtype-0.1.5 → qtype-0.1.6}/qtype/interpreter/executors/file_writer_executor.py +0 -0
  68. {qtype-0.1.5 → qtype-0.1.6}/qtype/interpreter/executors/index_upsert_executor.py +0 -0
  69. {qtype-0.1.5 → qtype-0.1.6}/qtype/interpreter/executors/invoke_flow_executor.py +0 -0
  70. {qtype-0.1.5 → qtype-0.1.6}/qtype/interpreter/executors/invoke_tool_executor.py +0 -0
  71. {qtype-0.1.5 → qtype-0.1.6}/qtype/interpreter/executors/llm_inference_executor.py +0 -0
  72. {qtype-0.1.5 → qtype-0.1.6}/qtype/interpreter/executors/prompt_template_executor.py +0 -0
  73. {qtype-0.1.5 → qtype-0.1.6}/qtype/interpreter/executors/sql_source_executor.py +0 -0
  74. {qtype-0.1.5 → qtype-0.1.6}/qtype/interpreter/executors/vector_search_executor.py +0 -0
  75. {qtype-0.1.5 → qtype-0.1.6}/qtype/interpreter/flow.py +0 -0
  76. {qtype-0.1.5 → qtype-0.1.6}/qtype/interpreter/logging_progress.py +0 -0
  77. {qtype-0.1.5 → qtype-0.1.6}/qtype/interpreter/metadata_api.py +0 -0
  78. {qtype-0.1.5 → qtype-0.1.6}/qtype/interpreter/resource_cache.py +0 -0
  79. {qtype-0.1.5 → qtype-0.1.6}/qtype/interpreter/rich_progress.py +0 -0
  80. {qtype-0.1.5 → qtype-0.1.6}/qtype/interpreter/stream/chat/__init__.py +0 -0
  81. {qtype-0.1.5 → qtype-0.1.6}/qtype/interpreter/stream/chat/converter.py +0 -0
  82. {qtype-0.1.5 → qtype-0.1.6}/qtype/interpreter/stream/chat/file_conversions.py +0 -0
  83. {qtype-0.1.5 → qtype-0.1.6}/qtype/interpreter/stream/chat/ui_request_to_domain_type.py +0 -0
  84. {qtype-0.1.5 → qtype-0.1.6}/qtype/interpreter/stream/chat/vercel.py +0 -0
  85. {qtype-0.1.5 → qtype-0.1.6}/qtype/interpreter/stream/utils/__init__.py +0 -0
  86. {qtype-0.1.5 → qtype-0.1.6}/qtype/interpreter/stream/utils/build_vercel_ai_formatter.py +0 -0
  87. {qtype-0.1.5 → qtype-0.1.6}/qtype/interpreter/stream/utils/callback_to_stream.py +0 -0
  88. {qtype-0.1.5 → qtype-0.1.6}/qtype/interpreter/stream/utils/create_streaming_response.py +0 -0
  89. {qtype-0.1.5 → qtype-0.1.6}/qtype/interpreter/stream/utils/default_chat_extract_text.py +0 -0
  90. {qtype-0.1.5 → qtype-0.1.6}/qtype/interpreter/stream/utils/error_streaming_response.py +0 -0
  91. {qtype-0.1.5 → qtype-0.1.6}/qtype/interpreter/telemetry.py +0 -0
  92. {qtype-0.1.5 → qtype-0.1.6}/qtype/interpreter/tools/__init__.py +0 -0
  93. {qtype-0.1.5 → qtype-0.1.6}/qtype/interpreter/tools/function_tool_helper.py +0 -0
  94. {qtype-0.1.5 → qtype-0.1.6}/qtype/interpreter/types.py +0 -0
  95. {qtype-0.1.5 → qtype-0.1.6}/qtype/interpreter/typing.py +0 -0
  96. {qtype-0.1.5 → qtype-0.1.6}/qtype/interpreter/ui/404/index.html +0 -0
  97. {qtype-0.1.5 → qtype-0.1.6}/qtype/interpreter/ui/404.html +0 -0
  98. {qtype-0.1.5 → qtype-0.1.6}/qtype/interpreter/ui/_next/static/20HoJN6otZ_LyHLHpCPE6/_buildManifest.js +0 -0
  99. {qtype-0.1.5 → qtype-0.1.6}/qtype/interpreter/ui/_next/static/20HoJN6otZ_LyHLHpCPE6/_ssgManifest.js +0 -0
  100. {qtype-0.1.5 → qtype-0.1.6}/qtype/interpreter/ui/_next/static/chunks/434-b2112d19f25c44ff.js +0 -0
  101. {qtype-0.1.5 → qtype-0.1.6}/qtype/interpreter/ui/_next/static/chunks/4bd1b696-cf72ae8a39fa05aa.js +0 -0
  102. {qtype-0.1.5 → qtype-0.1.6}/qtype/interpreter/ui/_next/static/chunks/964-2b041321a01cbf56.js +0 -0
  103. {qtype-0.1.5 → qtype-0.1.6}/qtype/interpreter/ui/_next/static/chunks/app/_not-found/page-e110d2a9d0a83d82.js +0 -0
  104. {qtype-0.1.5 → qtype-0.1.6}/qtype/interpreter/ui/_next/static/chunks/app/layout-a05273ead5de2c41.js +0 -0
  105. {qtype-0.1.5 → qtype-0.1.6}/qtype/interpreter/ui/_next/static/chunks/app/page-8c67d16ac90d23cb.js +0 -0
  106. {qtype-0.1.5 → qtype-0.1.6}/qtype/interpreter/ui/_next/static/chunks/ba12c10f-546f2714ff8abc66.js +0 -0
  107. {qtype-0.1.5 → qtype-0.1.6}/qtype/interpreter/ui/_next/static/chunks/framework-7c95b8e5103c9e90.js +0 -0
  108. {qtype-0.1.5 → qtype-0.1.6}/qtype/interpreter/ui/_next/static/chunks/main-app-6fc6346bc8f7f163.js +0 -0
  109. {qtype-0.1.5 → qtype-0.1.6}/qtype/interpreter/ui/_next/static/chunks/main-e26b9cb206da2cac.js +0 -0
  110. {qtype-0.1.5 → qtype-0.1.6}/qtype/interpreter/ui/_next/static/chunks/pages/_app-0a0020ddd67f79cf.js +0 -0
  111. {qtype-0.1.5 → qtype-0.1.6}/qtype/interpreter/ui/_next/static/chunks/pages/_error-03529f2c21436739.js +0 -0
  112. {qtype-0.1.5 → qtype-0.1.6}/qtype/interpreter/ui/_next/static/chunks/polyfills-42372ed130431b0a.js +0 -0
  113. {qtype-0.1.5 → qtype-0.1.6}/qtype/interpreter/ui/_next/static/chunks/webpack-08642e441b39b6c2.js +0 -0
  114. {qtype-0.1.5 → qtype-0.1.6}/qtype/interpreter/ui/_next/static/css/8a8d1269e362fef7.css +0 -0
  115. {qtype-0.1.5 → qtype-0.1.6}/qtype/interpreter/ui/_next/static/media/4cf2300e9c8272f7-s.p.woff2 +0 -0
  116. {qtype-0.1.5 → qtype-0.1.6}/qtype/interpreter/ui/_next/static/media/747892c23ea88013-s.woff2 +0 -0
  117. {qtype-0.1.5 → qtype-0.1.6}/qtype/interpreter/ui/_next/static/media/8d697b304b401681-s.woff2 +0 -0
  118. {qtype-0.1.5 → qtype-0.1.6}/qtype/interpreter/ui/_next/static/media/93f479601ee12b01-s.p.woff2 +0 -0
  119. {qtype-0.1.5 → qtype-0.1.6}/qtype/interpreter/ui/_next/static/media/9610d9e46709d722-s.woff2 +0 -0
  120. {qtype-0.1.5 → qtype-0.1.6}/qtype/interpreter/ui/_next/static/media/ba015fad6dcf6784-s.woff2 +0 -0
  121. {qtype-0.1.5 → qtype-0.1.6}/qtype/interpreter/ui/file.svg +0 -0
  122. {qtype-0.1.5 → qtype-0.1.6}/qtype/interpreter/ui/globe.svg +0 -0
  123. {qtype-0.1.5 → qtype-0.1.6}/qtype/interpreter/ui/icon.png +0 -0
  124. {qtype-0.1.5 → qtype-0.1.6}/qtype/interpreter/ui/index.html +0 -0
  125. {qtype-0.1.5 → qtype-0.1.6}/qtype/interpreter/ui/index.txt +0 -0
  126. {qtype-0.1.5 → qtype-0.1.6}/qtype/interpreter/ui/next.svg +0 -0
  127. {qtype-0.1.5 → qtype-0.1.6}/qtype/interpreter/ui/vercel.svg +0 -0
  128. {qtype-0.1.5 → qtype-0.1.6}/qtype/interpreter/ui/window.svg +0 -0
  129. {qtype-0.1.5 → qtype-0.1.6}/qtype/semantic/__init__.py +0 -0
  130. {qtype-0.1.5 → qtype-0.1.6}/qtype/semantic/base_types.py +0 -0
  131. {qtype-0.1.5 → qtype-0.1.6}/qtype/semantic/checker.py +0 -0
  132. {qtype-0.1.5 → qtype-0.1.6}/qtype/semantic/generate.py +0 -0
  133. {qtype-0.1.5 → qtype-0.1.6}/qtype/semantic/loader.py +0 -0
  134. {qtype-0.1.5 → qtype-0.1.6}/qtype/semantic/model.py +0 -0
  135. {qtype-0.1.5 → qtype-0.1.6}/qtype/semantic/resolver.py +0 -0
  136. {qtype-0.1.5 → qtype-0.1.6}/qtype/semantic/visualize.py +0 -0
  137. {qtype-0.1.5 → qtype-0.1.6}/qtype.egg-info/SOURCES.txt +0 -0
  138. {qtype-0.1.5 → qtype-0.1.6}/qtype.egg-info/dependency_links.txt +0 -0
  139. {qtype-0.1.5 → qtype-0.1.6}/qtype.egg-info/entry_points.txt +0 -0
  140. {qtype-0.1.5 → qtype-0.1.6}/qtype.egg-info/requires.txt +0 -0
  141. {qtype-0.1.5 → qtype-0.1.6}/qtype.egg-info/top_level.txt +0 -0
  142. {qtype-0.1.5 → qtype-0.1.6}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: qtype
3
- Version: 0.1.5
3
+ Version: 0.1.6
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.1.5"
3
+ version = "0.1.6"
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"
@@ -1,3 +1,4 @@
1
+ import asyncio
1
2
  import logging
2
3
  from typing import AsyncIterator
3
4
 
@@ -59,7 +60,17 @@ class DocumentEmbedderExecutor(StepExecutor):
59
60
  Returns:
60
61
  The embedding vector as a list of floats.
61
62
  """
62
- return await self.embedding_model.aget_text_embedding(text=text)
63
+
64
+ # TODO: switch back to async once aws auth supports it.
65
+ # https://github.com/bazaarvoice/qtype/issues/108
66
+ def _call():
67
+ return self.embedding_model.get_text_embedding(text=text)
68
+
69
+ loop = asyncio.get_running_loop()
70
+ response = await loop.run_in_executor(self.context.thread_pool, _call)
71
+
72
+ return response
73
+ # return await self.embedding_model.aget_text_embedding(text=text)
63
74
 
64
75
  async def process_message(
65
76
  self,
@@ -1,3 +1,4 @@
1
+ import asyncio
1
2
  from typing import AsyncIterator
2
3
 
3
4
  from openinference.semconv.trace import OpenInferenceSpanKindValues
@@ -56,32 +57,41 @@ class InvokeEmbeddingExecutor(StepExecutor):
56
57
  if input_value is None:
57
58
  raise ValueError(f"Input variable '{input_id}' is missing")
58
59
 
59
- # Generate embedding based on input type
60
- if input_type == PrimitiveTypeEnum.text:
61
- if not isinstance(input_value, str):
62
- input_value = str(input_value)
63
- vector = await self.embedding_model.aget_text_embedding(
64
- text=input_value
65
- )
66
- content = input_value
67
- elif input_type == PrimitiveTypeEnum.image:
68
- # For image embeddings
69
- vector = await self.embedding_model.aget_image_embedding(
70
- image_path=input_value
71
- )
72
- content = input_value
73
- else:
74
- raise ValueError(
75
- (
76
- f"Unsupported input type for embedding: "
77
- f"{input_type}. Must be 'text' or 'image'."
60
+ def _call(input_value=input_value):
61
+ # Generate embedding based on input type
62
+ if input_type == PrimitiveTypeEnum.text:
63
+ if not isinstance(input_value, str):
64
+ input_value = str(input_value)
65
+ vector = self.embedding_model.get_text_embedding(
66
+ text=input_value
67
+ )
68
+ content = input_value
69
+ elif input_type == PrimitiveTypeEnum.image:
70
+ # For image embeddings
71
+ vector = self.embedding_model.get_image_embedding(
72
+ image_path=input_value
78
73
  )
74
+ content = input_value
75
+ else:
76
+ raise ValueError(
77
+ (
78
+ f"Unsupported input type for embedding: "
79
+ f"{input_type}. Must be 'text' or 'image'."
80
+ )
81
+ )
82
+
83
+ # Create the Embedding object
84
+ embedding = Embedding(
85
+ vector=vector,
86
+ content=content,
79
87
  )
88
+ return embedding
80
89
 
81
- # Create the Embedding object
82
- embedding = Embedding(
83
- vector=vector,
84
- content=content,
90
+ # TODO: switch back to async once aws auth supports it.
91
+ # https://github.com/bazaarvoice/qtype/issues/108
92
+ loop = asyncio.get_running_loop()
93
+ embedding = await loop.run_in_executor(
94
+ self.context.thread_pool, _call
85
95
  )
86
96
 
87
97
  # Yield the result
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: qtype
3
- Version: 0.1.5
3
+ Version: 0.1.6
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
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes