qtype 0.1.12__py3-none-any.whl → 0.1.14__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/` +0 -0
- qtype/application/__init__.py +0 -2
- qtype/application/converters/tools_from_api.py +28 -22
- qtype/application/converters/tools_from_module.py +66 -32
- qtype/base/__init__.py +8 -2
- qtype/base/logging.py +0 -17
- qtype/base/resources.py +193 -0
- qtype/cli.py +5 -9
- qtype/commands/generate.py +95 -7
- qtype/commands/run.py +153 -54
- qtype/docs/.pages +8 -0
- {docs → qtype/docs}/Concepts/mental-model-and-philosophy.md +1 -1
- qtype/docs/Contributing/.pages +4 -0
- {docs → qtype/docs}/Contributing/index.md +8 -1
- {docs → qtype/docs}/Gallery/dataflow_pipelines.md +18 -4
- qtype/docs/Gallery/recipe_chatbot.md +103 -0
- qtype/docs/Gallery/recipe_chatbot.mermaid +62 -0
- qtype/docs/Gallery/recipe_chatbot.png +0 -0
- {docs → qtype/docs}/Gallery/research_assistant.md +4 -5
- {docs → qtype/docs}/Gallery/simple_chatbot.md +3 -1
- {docs → qtype/docs}/How To/Authentication/configure_aws_authentication.md +2 -2
- {docs → qtype/docs}/How To/Authentication/use_api_key_authentication.md +2 -2
- {docs → qtype/docs}/How To/Command Line Usage/load_multiple_inputs_from_files.md +24 -9
- {docs → qtype/docs}/How To/Command Line Usage/pass_inputs_on_the_cli.md +7 -4
- {docs → qtype/docs}/How To/Command Line Usage/serve_with_auto_reload.md +3 -2
- {docs → qtype/docs}/How To/Data Processing/adjust_concurrency.md +3 -4
- {docs → qtype/docs}/How To/Data Processing/cache_step_results.md +2 -2
- {docs → qtype/docs}/How To/Data Processing/decode_json_xml.md +1 -1
- {docs → qtype/docs}/How To/Data Processing/explode_collections.md +2 -2
- {docs → qtype/docs}/How To/Data Processing/gather_results.md +4 -4
- qtype/docs/How To/Data Processing/invoke_other_flows.md +71 -0
- qtype/docs/How To/Data Processing/load_data_from_athena.md +49 -0
- qtype/docs/How To/Data Processing/load_documents.md +74 -0
- qtype/docs/How To/Data Processing/read_data_from_files.md +61 -0
- {docs → qtype/docs}/How To/Data Processing/read_sql_databases.md +4 -3
- {docs → qtype/docs}/How To/Data Processing/write_data_to_file.md +1 -2
- {docs → qtype/docs}/How To/Invoke Models/call_large_language_models.md +1 -1
- {docs → qtype/docs}/How To/Invoke Models/create_embeddings.md +1 -1
- {docs → qtype/docs}/How To/Invoke Models/reuse_prompts_with_templates.md +2 -3
- {docs → qtype/docs}/How To/Language Features/include_raw_text_from_other_files.md +2 -1
- {docs → qtype/docs}/How To/Language Features/reference_entities_by_id.md +2 -2
- qtype/docs/How To/Language Features/use_agent_skills.md +29 -0
- {docs → qtype/docs}/How To/Language Features/use_environment_variables.md +2 -1
- qtype/docs/How To/Language Features/use_optional_variables.md +42 -0
- {docs → qtype/docs}/How To/Language Features/use_qtype_mcp.md +4 -4
- {docs → qtype/docs}/How To/Observability & Debugging/trace_calls_with_open_telemetry.md +1 -1
- {docs → qtype/docs}/How To/Observability & Debugging/validate_qtype_yaml.md +3 -2
- {docs → qtype/docs}/How To/Observability & Debugging/visualize_application_architecture.md +1 -1
- {docs → qtype/docs}/How To/Qtype Server/serve_flows_as_apis.md +3 -3
- {docs → qtype/docs}/How To/Qtype Server/serve_flows_as_ui.md +2 -3
- {docs → qtype/docs}/How To/Qtype Server/use_conversational_interfaces.md +1 -4
- {docs → qtype/docs}/How To/Qtype Server/use_variables_with_ui_hints.md +3 -2
- {docs → qtype/docs}/How To/Tools & Integration/bind_tool_inputs_and_outputs.md +1 -2
- {docs → qtype/docs}/How To/Tools & Integration/create_tools_from_openapi_specifications.md +10 -14
- {docs → qtype/docs}/How To/Tools & Integration/create_tools_from_python_modules.md +5 -8
- {docs → qtype/docs}/Reference/cli.md +16 -17
- qtype/docs/Tutorials/.pages +1 -0
- {docs → qtype/docs}/Tutorials/01-first-qtype-application.md +4 -3
- {docs → qtype/docs}/Tutorials/02-conversational-chatbot.md +3 -3
- {docs → qtype/docs}/Tutorials/03-structured-data.md +10 -11
- {docs → qtype/docs}/Tutorials/04-tools-and-function-calling.md +13 -20
- {docs → qtype/docs}/components/APITool.md +1 -1
- qtype/docs/components/Aggregate.md +7 -0
- qtype/docs/components/Collect.md +6 -0
- qtype/docs/components/Construct.md +6 -0
- {docs → qtype/docs}/components/DocumentEmbedder.md +0 -1
- {docs → qtype/docs}/components/DocumentSplitter.md +0 -1
- qtype/docs/components/Explode.md +5 -0
- {docs → qtype/docs}/components/FieldExtractor.md +2 -1
- qtype/docs/components/InvokeFlow.md +8 -0
- qtype/docs/components/InvokeTool.md +8 -0
- {docs → qtype/docs}/components/PrimitiveTypeEnum.md +0 -1
- {docs → qtype/docs}/components/Source.md +0 -1
- {docs → qtype/docs}/components/Step.md +0 -1
- {docs → qtype/docs}/components/Tool.md +2 -2
- {docs → qtype/docs}/components/Variable.md +2 -0
- qtype/docs/legacy_how_tos/.pages +6 -0
- qtype/docs/skills/architect/SKILL.md +188 -0
- qtype/docs/skills/architect/references/cheatsheet.md +198 -0
- qtype/docs/skills/architect/references/patterns.md +29 -0
- qtype/docs/stylesheets/extra.css +27 -0
- qtype/dsl/linker.py +8 -0
- qtype/dsl/model.py +177 -84
- qtype/examples/conversational_ai/simple_chatbot_with_auth.qtype.yaml +48 -0
- qtype/examples/data_processing/athena_query.qtype.yaml +56 -0
- qtype/examples/data_processing/batch_inputs.csv +5 -0
- qtype/examples/data_processing/create_sample_db.py +129 -0
- qtype/examples/data_processing/invoke_other_flows.qtype.yaml +98 -0
- qtype/examples/data_processing/load_documents.qtype.yaml +31 -0
- qtype/examples/data_processing/reviews.db +0 -0
- qtype/examples/data_processing/sample_article.txt +1 -0
- qtype/examples/data_processing/sample_documents.jsonl +5 -0
- qtype/examples/invoke_models/invoke_embedding_aws.qtype.yaml +45 -0
- qtype/examples/language_features/optional_variables.qtype.yaml +32 -0
- qtype/examples/language_features/story_prompt.txt +6 -0
- qtype/examples/legacy/data/customers.csv +6 -0
- qtype/examples/legacy/echo/readme.md +29 -0
- qtype/examples/legacy/qtype_plugin_example.py +51 -0
- qtype/examples/legacy/sample_data.txt +43 -0
- qtype/examples/legacy/vertex/README.md +11 -0
- qtype/examples/rag/recipe_chatbot.qtype.yaml +216 -0
- qtype/examples/research_assistant/tavily.qtype.yaml +216 -0
- {examples → qtype/examples}/tutorials/03_structured_data.qtype.yaml +2 -2
- {examples → qtype/examples}/tutorials/04_tools_and_function_calling.qtype.yaml +5 -5
- qtype/interpreter/auth/aws.py +94 -17
- qtype/interpreter/auth/generic.py +11 -12
- qtype/interpreter/base/secrets.py +4 -2
- qtype/interpreter/base/stream_emitter.py +19 -13
- qtype/interpreter/conversions.py +15 -14
- qtype/interpreter/converters.py +142 -26
- qtype/interpreter/executors/agent_executor.py +2 -3
- qtype/interpreter/executors/aggregate_executor.py +3 -4
- qtype/interpreter/executors/bedrock_reranker_executor.py +17 -28
- qtype/interpreter/executors/construct_executor.py +15 -15
- qtype/interpreter/executors/doc_to_text_executor.py +1 -3
- qtype/interpreter/executors/document_embedder_executor.py +1 -12
- qtype/interpreter/executors/field_extractor_executor.py +13 -12
- qtype/interpreter/executors/file_source_executor.py +18 -31
- qtype/interpreter/executors/invoke_embedding_executor.py +24 -37
- qtype/interpreter/executors/invoke_flow_executor.py +2 -2
- qtype/interpreter/executors/invoke_tool_executor.py +19 -18
- qtype/interpreter/executors/llm_inference_executor.py +18 -18
- qtype/interpreter/executors/prompt_template_executor.py +1 -3
- qtype/interpreter/executors/sql_source_executor.py +6 -2
- qtype/interpreter/flow.py +11 -1
- qtype/interpreter/tools/function_tool_helper.py +11 -10
- qtype/interpreter/types.py +89 -4
- qtype/interpreter/typing.py +31 -32
- qtype/mcp/server.py +194 -86
- {schema → qtype/schema}/qtype.schema.json +77 -79
- qtype/semantic/checker.py +19 -0
- qtype/semantic/generate.py +3 -6
- qtype/semantic/model.py +26 -33
- qtype/semantic/resolver.py +7 -0
- qtype/semantic/visualize.py +18 -6
- {qtype-0.1.12.dist-info → qtype-0.1.14.dist-info}/METADATA +47 -46
- qtype-0.1.14.dist-info/RECORD +361 -0
- {qtype-0.1.12.dist-info → qtype-0.1.14.dist-info}/WHEEL +1 -2
- docs/How To/Data Processing/read_data_from_files.md +0 -35
- docs/components/Aggregate.md +0 -8
- docs/components/InvokeFlow.md +0 -8
- docs/components/InvokeTool.md +0 -8
- docs/components/ToolParameter.md +0 -6
- examples/research_assistant/tavily.qtype.yaml +0 -289
- qtype/application/facade.py +0 -177
- qtype-0.1.12.dist-info/RECORD +0 -325
- qtype-0.1.12.dist-info/top_level.txt +0 -1
- {docs → qtype/docs}/Contributing/roadmap.md +0 -0
- {docs → qtype/docs}/Decisions/ADR-001-Chat-vs-Completion-Endpoint-Features.md +0 -0
- {docs → qtype/docs}/Gallery/dataflow_pipelines.mermaid +0 -0
- {docs → qtype/docs}/Gallery/research_assistant.mermaid +0 -0
- {docs → qtype/docs}/Gallery/simple_chatbot.mermaid +0 -0
- {docs → qtype/docs}/How To/Language Features/include_qtype_yaml.md +0 -0
- {docs → qtype/docs}/How To/Observability & Debugging/visualize_example.mermaid +0 -0
- {docs → qtype/docs}/How To/Qtype Server/flow_as_ui.png +0 -0
- {docs → qtype/docs}/Reference/plugins.md +0 -0
- {docs → qtype/docs}/Reference/semantic-validation-rules.md +0 -0
- {docs → qtype/docs}/Tutorials/example_chat.png +0 -0
- {docs → qtype/docs}/Tutorials/index.md +0 -0
- {docs → qtype/docs}/components/APIKeyAuthProvider.md +0 -0
- {docs → qtype/docs}/components/AWSAuthProvider.md +0 -0
- {docs → qtype/docs}/components/AWSSecretManager.md +0 -0
- {docs → qtype/docs}/components/Agent.md +0 -0
- {docs → qtype/docs}/components/AggregateStats.md +0 -0
- {docs → qtype/docs}/components/Application.md +0 -0
- {docs → qtype/docs}/components/AuthorizationProvider.md +0 -0
- {docs → qtype/docs}/components/AuthorizationProviderList.md +0 -0
- {docs → qtype/docs}/components/BearerTokenAuthProvider.md +0 -0
- {docs → qtype/docs}/components/BedrockReranker.md +0 -0
- {docs → qtype/docs}/components/ChatContent.md +0 -0
- {docs → qtype/docs}/components/ChatMessage.md +0 -0
- {docs → qtype/docs}/components/ConstantPath.md +0 -0
- {docs → qtype/docs}/components/CustomType.md +0 -0
- {docs → qtype/docs}/components/Decoder.md +0 -0
- {docs → qtype/docs}/components/DecoderFormat.md +0 -0
- {docs → qtype/docs}/components/DocToTextConverter.md +0 -0
- {docs → qtype/docs}/components/Document.md +0 -0
- {docs → qtype/docs}/components/DocumentIndex.md +0 -0
- {docs → qtype/docs}/components/DocumentSearch.md +0 -0
- {docs → qtype/docs}/components/DocumentSource.md +0 -0
- {docs → qtype/docs}/components/Echo.md +0 -0
- {docs → qtype/docs}/components/Embedding.md +0 -0
- {docs → qtype/docs}/components/EmbeddingModel.md +0 -0
- {docs → qtype/docs}/components/FileSource.md +0 -0
- {docs → qtype/docs}/components/FileWriter.md +0 -0
- {docs → qtype/docs}/components/Flow.md +0 -0
- {docs → qtype/docs}/components/FlowInterface.md +0 -0
- {docs → qtype/docs}/components/Index.md +0 -0
- {docs → qtype/docs}/components/IndexUpsert.md +0 -0
- {docs → qtype/docs}/components/InvokeEmbedding.md +0 -0
- {docs → qtype/docs}/components/LLMInference.md +0 -0
- {docs → qtype/docs}/components/ListType.md +0 -0
- {docs → qtype/docs}/components/Memory.md +0 -0
- {docs → qtype/docs}/components/MessageRole.md +0 -0
- {docs → qtype/docs}/components/Model.md +0 -0
- {docs → qtype/docs}/components/ModelList.md +0 -0
- {docs → qtype/docs}/components/OAuth2AuthProvider.md +0 -0
- {docs → qtype/docs}/components/PromptTemplate.md +0 -0
- {docs → qtype/docs}/components/PythonFunctionTool.md +0 -0
- {docs → qtype/docs}/components/RAGChunk.md +0 -0
- {docs → qtype/docs}/components/RAGDocument.md +0 -0
- {docs → qtype/docs}/components/RAGSearchResult.md +0 -0
- {docs → qtype/docs}/components/Reranker.md +0 -0
- {docs → qtype/docs}/components/SQLSource.md +0 -0
- {docs → qtype/docs}/components/Search.md +0 -0
- {docs → qtype/docs}/components/SearchResult.md +0 -0
- {docs → qtype/docs}/components/SecretManager.md +0 -0
- {docs → qtype/docs}/components/SecretReference.md +0 -0
- {docs → qtype/docs}/components/TelemetrySink.md +0 -0
- {docs → qtype/docs}/components/ToolList.md +0 -0
- {docs → qtype/docs}/components/TypeList.md +0 -0
- {docs → qtype/docs}/components/VariableList.md +0 -0
- {docs → qtype/docs}/components/VectorIndex.md +0 -0
- {docs → qtype/docs}/components/VectorSearch.md +0 -0
- {docs → qtype/docs}/components/VertexAuthProvider.md +0 -0
- {docs → qtype/docs}/components/Writer.md +0 -0
- {docs → qtype/docs}/example_ui.png +0 -0
- {docs → qtype/docs}/index.md +0 -0
- {docs → qtype/docs}/legacy_how_tos/Configuration/modular-yaml.md +0 -0
- {docs → qtype/docs}/legacy_how_tos/Configuration/phoenix_projects.png +0 -0
- {docs → qtype/docs}/legacy_how_tos/Configuration/phoenix_traces.png +0 -0
- {docs → qtype/docs}/legacy_how_tos/Configuration/reference-by-id.md +0 -0
- {docs → qtype/docs}/legacy_how_tos/Configuration/telemetry-setup.md +0 -0
- {docs → qtype/docs}/legacy_how_tos/Data Types/custom-types.md +0 -0
- {docs → qtype/docs}/legacy_how_tos/Data Types/domain-types.md +0 -0
- {docs → qtype/docs}/legacy_how_tos/Debugging/visualize-apps.md +0 -0
- {docs → qtype/docs}/legacy_how_tos/Tools/api-tools.md +0 -0
- {docs → qtype/docs}/legacy_how_tos/Tools/python-tools.md +0 -0
- {examples → qtype/examples}/authentication/aws_authentication.qtype.yaml +0 -0
- {examples → qtype/examples}/conversational_ai/hello_world_chat.qtype.yaml +0 -0
- {examples → qtype/examples}/conversational_ai/simple_chatbot.qtype.yaml +0 -0
- {examples → qtype/examples}/data_processing/batch_processing.qtype.yaml +0 -0
- {examples → qtype/examples}/data_processing/cache_step_results.qtype.yaml +0 -0
- {examples → qtype/examples}/data_processing/collect_results.qtype.yaml +0 -0
- {examples → qtype/examples}/data_processing/dataflow_pipelines.qtype.yaml +0 -0
- {examples → qtype/examples}/data_processing/decode_json.qtype.yaml +0 -0
- {examples → qtype/examples}/data_processing/explode_items.qtype.yaml +0 -0
- {examples → qtype/examples}/data_processing/read_file.qtype.yaml +0 -0
- {examples → qtype/examples}/invoke_models/create_embeddings.qtype.yaml +0 -0
- {examples → qtype/examples}/invoke_models/simple_llm_call.qtype.yaml +0 -0
- {examples → qtype/examples}/language_features/include_raw.qtype.yaml +0 -0
- {examples → qtype/examples}/language_features/ui_hints.qtype.yaml +0 -0
- {examples → qtype/examples}/legacy/bedrock/data_analysis_with_telemetry.qtype.yaml +0 -0
- {examples → qtype/examples}/legacy/bedrock/hello_world.qtype.yaml +0 -0
- {examples → qtype/examples}/legacy/bedrock/hello_world_chat.qtype.yaml +0 -0
- {examples → qtype/examples}/legacy/bedrock/hello_world_chat_with_telemetry.qtype.yaml +0 -0
- {examples → qtype/examples}/legacy/bedrock/hello_world_chat_with_thinking.qtype.yaml +0 -0
- {examples → qtype/examples}/legacy/bedrock/hello_world_completion.qtype.yaml +0 -0
- {examples → qtype/examples}/legacy/bedrock/hello_world_completion_with_auth.qtype.yaml +0 -0
- {examples → qtype/examples}/legacy/bedrock/simple_agent_chat.qtype.yaml +0 -0
- {examples → qtype/examples}/legacy/chat_with_langfuse.qtype.yaml +0 -0
- {examples → qtype/examples}/legacy/data_processor.qtype.yaml +0 -0
- {examples → qtype/examples}/legacy/echo/debug_example.qtype.yaml +0 -0
- {examples → qtype/examples}/legacy/echo/prompt.qtype.yaml +0 -0
- {examples → qtype/examples}/legacy/echo/test.qtype.yaml +0 -0
- {examples → qtype/examples}/legacy/echo/video.qtype.yaml +0 -0
- {examples → qtype/examples}/legacy/field_extractor_example.qtype.yaml +0 -0
- {examples → qtype/examples}/legacy/multi_flow_example.qtype.yaml +0 -0
- {examples → qtype/examples}/legacy/openai/hello_world_chat.qtype.yaml +0 -0
- {examples → qtype/examples}/legacy/openai/hello_world_chat_with_telemetry.qtype.yaml +0 -0
- {examples → qtype/examples}/legacy/rag.qtype.yaml +0 -0
- {examples → qtype/examples}/legacy/time_utilities.qtype.yaml +0 -0
- {examples → qtype/examples}/legacy/vertex/hello_world_chat.qtype.yaml +0 -0
- {examples → qtype/examples}/legacy/vertex/hello_world_completion.qtype.yaml +0 -0
- {examples → qtype/examples}/legacy/vertex/hello_world_completion_with_auth.qtype.yaml +0 -0
- {examples → qtype/examples}/observability_debugging/trace_with_opentelemetry.qtype.yaml +0 -0
- {examples → qtype/examples}/research_assistant/research_assistant.qtype.yaml +0 -0
- {examples → qtype/examples}/research_assistant/tavily.oas.yaml +0 -0
- {examples → qtype/examples}/tutorials/01_hello_world.qtype.yaml +0 -0
- {examples → qtype/examples}/tutorials/02_conversational_chat.qtype.yaml +0 -0
- {qtype-0.1.12.dist-info → qtype-0.1.14.dist-info}/entry_points.txt +0 -0
- {qtype-0.1.12.dist-info → qtype-0.1.14.dist-info}/licenses/LICENSE +0 -0
qtype/semantic/generate.py
CHANGED
|
@@ -144,8 +144,7 @@ def generate_semantic_model(args: argparse.Namespace) -> None:
|
|
|
144
144
|
CustomType,
|
|
145
145
|
DecoderFormat,
|
|
146
146
|
ListType,
|
|
147
|
-
PrimitiveTypeEnum
|
|
148
|
-
ToolParameter
|
|
147
|
+
PrimitiveTypeEnum
|
|
149
148
|
)
|
|
150
149
|
from qtype.dsl.model import Variable as DSLVariable # noqa: F401
|
|
151
150
|
from qtype.dsl.model import VariableType # noqa: F401
|
|
@@ -158,10 +157,8 @@ def generate_semantic_model(args: argparse.Namespace) -> None:
|
|
|
158
157
|
f.write(
|
|
159
158
|
dedent('''
|
|
160
159
|
class Variable(DSLVariable, BaseModel):
|
|
161
|
-
"""Semantic version of DSL Variable
|
|
162
|
-
|
|
163
|
-
def is_set(self) -> bool:
|
|
164
|
-
return self.value is not None
|
|
160
|
+
"""Semantic version of DSL Variable."""
|
|
161
|
+
pass
|
|
165
162
|
|
|
166
163
|
''').lstrip()
|
|
167
164
|
)
|
qtype/semantic/model.py
CHANGED
|
@@ -32,19 +32,15 @@ from qtype.dsl.model import ( # noqa: F401
|
|
|
32
32
|
DecoderFormat,
|
|
33
33
|
ListType,
|
|
34
34
|
PrimitiveTypeEnum,
|
|
35
|
-
ToolParameter,
|
|
36
35
|
)
|
|
37
36
|
from qtype.dsl.model import Variable as DSLVariable # noqa: F401
|
|
38
37
|
from qtype.semantic.base_types import ImmutableModel
|
|
39
38
|
|
|
40
39
|
|
|
41
40
|
class Variable(DSLVariable, BaseModel):
|
|
42
|
-
"""Semantic version of DSL Variable
|
|
41
|
+
"""Semantic version of DSL Variable."""
|
|
43
42
|
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
def is_set(self) -> bool:
|
|
47
|
-
return self.value is not None
|
|
43
|
+
pass
|
|
48
44
|
|
|
49
45
|
|
|
50
46
|
class AuthorizationProvider(ImmutableModel):
|
|
@@ -66,12 +62,12 @@ class Tool(ImmutableModel):
|
|
|
66
62
|
description: str = Field(
|
|
67
63
|
..., description="Description of what the tool does."
|
|
68
64
|
)
|
|
69
|
-
inputs:
|
|
70
|
-
default_factory=
|
|
65
|
+
inputs: list[Variable] = Field(
|
|
66
|
+
default_factory=list,
|
|
71
67
|
description="Input parameters required by this tool.",
|
|
72
68
|
)
|
|
73
|
-
outputs:
|
|
74
|
-
default_factory=
|
|
69
|
+
outputs: list[Variable] = Field(
|
|
70
|
+
default_factory=list,
|
|
75
71
|
description="Output parameters produced by this tool.",
|
|
76
72
|
)
|
|
77
73
|
|
|
@@ -421,9 +417,9 @@ class APITool(Tool):
|
|
|
421
417
|
default_factory=dict,
|
|
422
418
|
description="Optional HTTP headers to include in the request.",
|
|
423
419
|
)
|
|
424
|
-
parameters:
|
|
425
|
-
default_factory=
|
|
426
|
-
description="
|
|
420
|
+
parameters: list[Variable] = Field(
|
|
421
|
+
default_factory=list,
|
|
422
|
+
description="Path and query parameters for the API call.",
|
|
427
423
|
)
|
|
428
424
|
|
|
429
425
|
|
|
@@ -447,15 +443,12 @@ class AWSSecretManager(SecretManager):
|
|
|
447
443
|
|
|
448
444
|
class Aggregate(Step):
|
|
449
445
|
"""
|
|
450
|
-
A
|
|
451
|
-
|
|
446
|
+
A step that, after all messages have been processed,
|
|
447
|
+
returns a single message containing the counts of successful and failed
|
|
448
|
+
messages. Other messages are passed through unchanged.
|
|
452
449
|
"""
|
|
453
450
|
|
|
454
451
|
type: Literal["Aggregate"] = Field("Aggregate")
|
|
455
|
-
outputs: list[Variable] = Field(
|
|
456
|
-
default_factory=list,
|
|
457
|
-
description="References to the variables for the output. There should be one and only one output with type AggregateStats",
|
|
458
|
-
)
|
|
459
452
|
|
|
460
453
|
|
|
461
454
|
class Collect(Step, BatchableStepMixin):
|
|
@@ -472,8 +465,9 @@ class Construct(Step):
|
|
|
472
465
|
"""A step that converts variables into an instance of a Custom or Domain Type"""
|
|
473
466
|
|
|
474
467
|
type: Literal["Construct"] = Field("Construct")
|
|
475
|
-
|
|
476
|
-
...,
|
|
468
|
+
field_bindings: dict[str, Variable] = Field(
|
|
469
|
+
...,
|
|
470
|
+
description="Mapping from type field names to flow variable names.",
|
|
477
471
|
)
|
|
478
472
|
|
|
479
473
|
|
|
@@ -558,6 +552,9 @@ class FieldExtractor(Step):
|
|
|
558
552
|
The extracted data is used to construct the output variable by passing it
|
|
559
553
|
as keyword arguments to the output type's constructor.
|
|
560
554
|
|
|
555
|
+
If there is no match and the output variable is optional, it is set to None.
|
|
556
|
+
If there is no match and the output variable is required, an error is raised.
|
|
557
|
+
|
|
561
558
|
Example JSONPath expressions:
|
|
562
559
|
- `$.field_name` - Extract a single field
|
|
563
560
|
- `$.items[*]` - Extract all items from a list
|
|
@@ -569,10 +566,6 @@ class FieldExtractor(Step):
|
|
|
569
566
|
...,
|
|
570
567
|
description="JSONPath expression to extract data from the input. Uses jsonpath-ng syntax.",
|
|
571
568
|
)
|
|
572
|
-
fail_on_missing: bool = Field(
|
|
573
|
-
True,
|
|
574
|
-
description="Whether to raise an error if the JSONPath matches no data. If False, returns None.",
|
|
575
|
-
)
|
|
576
569
|
|
|
577
570
|
|
|
578
571
|
class InvokeEmbedding(Step, ConcurrentStepMixin):
|
|
@@ -590,13 +583,13 @@ class InvokeFlow(Step):
|
|
|
590
583
|
|
|
591
584
|
type: Literal["InvokeFlow"] = Field("InvokeFlow")
|
|
592
585
|
flow: Flow = Field(..., description="Flow to invoke.")
|
|
593
|
-
input_bindings: dict[
|
|
586
|
+
input_bindings: dict[str, Variable] = Field(
|
|
594
587
|
...,
|
|
595
|
-
description="Mapping from variable
|
|
588
|
+
description="Mapping from flow input variable IDs to step variable names.",
|
|
596
589
|
)
|
|
597
|
-
output_bindings: dict[
|
|
590
|
+
output_bindings: dict[str, Variable] = Field(
|
|
598
591
|
...,
|
|
599
|
-
description="Mapping from variable
|
|
592
|
+
description="Mapping from flow output variable IDs to step variable names.",
|
|
600
593
|
)
|
|
601
594
|
|
|
602
595
|
|
|
@@ -605,13 +598,13 @@ class InvokeTool(Step, ConcurrentStepMixin):
|
|
|
605
598
|
|
|
606
599
|
type: Literal["InvokeTool"] = Field("InvokeTool")
|
|
607
600
|
tool: Tool = Field(..., description="Tool to invoke.")
|
|
608
|
-
input_bindings: dict[str,
|
|
601
|
+
input_bindings: dict[str, Variable] = Field(
|
|
609
602
|
...,
|
|
610
|
-
description="Mapping from
|
|
603
|
+
description="Mapping from tool parameter names to flow variable names.",
|
|
611
604
|
)
|
|
612
|
-
output_bindings: dict[str,
|
|
605
|
+
output_bindings: dict[str, Variable] = Field(
|
|
613
606
|
...,
|
|
614
|
-
description="Mapping from
|
|
607
|
+
description="Mapping from tool output names to flow variable names.",
|
|
615
608
|
)
|
|
616
609
|
|
|
617
610
|
|
qtype/semantic/resolver.py
CHANGED
|
@@ -71,6 +71,13 @@ def to_semantic_ir(
|
|
|
71
71
|
# If the object is already in the symbol table, return it.
|
|
72
72
|
return symbol_table[obj_id]
|
|
73
73
|
|
|
74
|
+
if isinstance(dslobj, dict):
|
|
75
|
+
# If the object is a dict, recursively resolve each value
|
|
76
|
+
return {
|
|
77
|
+
key: to_semantic_ir(value, symbol_table)
|
|
78
|
+
for key, value in dslobj.items()
|
|
79
|
+
}
|
|
80
|
+
|
|
74
81
|
if isinstance(dslobj, list):
|
|
75
82
|
# If the object is a list, we will resolve each item in the list.
|
|
76
83
|
return [to_semantic_ir(item, symbol_table) for item in dslobj] # type: ignore
|
qtype/semantic/visualize.py
CHANGED
|
@@ -11,7 +11,6 @@ from typing import Any
|
|
|
11
11
|
|
|
12
12
|
from pydantic import BaseModel
|
|
13
13
|
|
|
14
|
-
from qtype.dsl.model import Index
|
|
15
14
|
from qtype.semantic.model import (
|
|
16
15
|
Agent,
|
|
17
16
|
APITool,
|
|
@@ -21,6 +20,9 @@ from qtype.semantic.model import (
|
|
|
21
20
|
DocumentIndex,
|
|
22
21
|
DocumentSearch,
|
|
23
22
|
Flow,
|
|
23
|
+
Index,
|
|
24
|
+
IndexUpsert,
|
|
25
|
+
InvokeFlow,
|
|
24
26
|
InvokeTool,
|
|
25
27
|
LLMInference,
|
|
26
28
|
Memory,
|
|
@@ -168,10 +170,14 @@ def _generate_step_node(
|
|
|
168
170
|
lines = []
|
|
169
171
|
external_connections = []
|
|
170
172
|
|
|
171
|
-
if isinstance(step,
|
|
172
|
-
# Nested flow
|
|
173
|
+
if isinstance(step, InvokeFlow):
|
|
173
174
|
lines.append(
|
|
174
|
-
f' {node_id}@{{shape:
|
|
175
|
+
f' {node_id}@{{shape: sub-r, label: "🔄 {step.id}"}}'
|
|
176
|
+
)
|
|
177
|
+
# Connect to the invoked flow
|
|
178
|
+
invoked_flow_id = f"FLOW_{_sanitize_id(step.flow.id)}"
|
|
179
|
+
external_connections.append(
|
|
180
|
+
f" {node_id} -.->|invokes| {invoked_flow_id}"
|
|
175
181
|
)
|
|
176
182
|
elif isinstance(step, Agent):
|
|
177
183
|
# Agent with tools
|
|
@@ -233,6 +239,12 @@ def _generate_step_node(
|
|
|
233
239
|
)
|
|
234
240
|
index_id = f"INDEX_{_sanitize_id(step.index.id)}"
|
|
235
241
|
external_connections.append(f" {node_id} -.-> {index_id}")
|
|
242
|
+
elif isinstance(step, IndexUpsert):
|
|
243
|
+
lines.append(
|
|
244
|
+
f' {node_id}@{{shape: rect, label: "💾 {step.id}"}}'
|
|
245
|
+
)
|
|
246
|
+
index_id = f"INDEX_{_sanitize_id(step.index.id)}"
|
|
247
|
+
external_connections.append(f" {node_id} -.->|writes| {index_id}")
|
|
236
248
|
else:
|
|
237
249
|
# Generic step
|
|
238
250
|
lines.append(
|
|
@@ -377,7 +389,7 @@ def _generate_shared_resources(app: Application) -> list[str]:
|
|
|
377
389
|
index_id = f"INDEX_{_sanitize_id(index.id)}"
|
|
378
390
|
if isinstance(index, VectorIndex):
|
|
379
391
|
lines.append(
|
|
380
|
-
f' {index_id}@{{shape: cyl, label: "
|
|
392
|
+
f' {index_id}@{{shape: cyl, label: "�️ {index.id}"}}'
|
|
381
393
|
)
|
|
382
394
|
# Connect to embedding model
|
|
383
395
|
emb_model_id = f"EMB_{_sanitize_id(index.embedding_model.id)}"
|
|
@@ -391,7 +403,7 @@ def _generate_shared_resources(app: Application) -> list[str]:
|
|
|
391
403
|
)
|
|
392
404
|
else:
|
|
393
405
|
lines.append(
|
|
394
|
-
f' {index_id}@{{shape: cyl, label: "
|
|
406
|
+
f' {index_id}@{{shape: cyl, label: "�️ {index.id}"}}'
|
|
395
407
|
)
|
|
396
408
|
|
|
397
409
|
if index.auth:
|
|
@@ -1,60 +1,61 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: qtype
|
|
3
|
-
Version: 0.1.
|
|
3
|
+
Version: 0.1.14
|
|
4
4
|
Summary: DSL for Generative AI Prototyping
|
|
5
|
+
Project-URL: Homepage, https://github.com/bazaarvoice/qtype
|
|
5
6
|
Author-email: Lou Kratz <lou.kratz+qtype@bazaarvoice.com>
|
|
6
7
|
License-Expression: Apache-2.0
|
|
7
|
-
Project-URL: Homepage, https://github.com/bazaarvoice/qtype
|
|
8
|
-
Requires-Python: >=3.10
|
|
9
|
-
Description-Content-Type: text/markdown
|
|
10
8
|
License-File: LICENSE
|
|
11
|
-
Requires-
|
|
12
|
-
Requires-Dist:
|
|
13
|
-
Requires-Dist: pyyaml>=6.0.2
|
|
14
|
-
Requires-Dist: python-dotenv>=1.0.0
|
|
15
|
-
Requires-Dist: openai>=1.93.0
|
|
9
|
+
Requires-Python: >=3.10
|
|
10
|
+
Requires-Dist: cachetools>=6.2.1
|
|
16
11
|
Requires-Dist: fsspec>=2025.5.1
|
|
12
|
+
Requires-Dist: google-cloud-aiplatform>=1.120.0
|
|
13
|
+
Requires-Dist: jsonschema>=4.24.0
|
|
17
14
|
Requires-Dist: mkdocs-awesome-pages-plugin>=2.10.1
|
|
18
|
-
Requires-Dist:
|
|
15
|
+
Requires-Dist: openai>=1.93.0
|
|
19
16
|
Requires-Dist: openapi3-parser>=1.1.21
|
|
17
|
+
Requires-Dist: pip-system-certs>=5.2
|
|
20
18
|
Requires-Dist: pydantic-yaml>=1.6.0
|
|
21
|
-
Requires-Dist:
|
|
19
|
+
Requires-Dist: pydantic>=2.12.4
|
|
20
|
+
Requires-Dist: python-dotenv>=1.0.0
|
|
21
|
+
Requires-Dist: pyyaml>=6.0.2
|
|
22
22
|
Provides-Extra: interpreter
|
|
23
|
-
Requires-Dist: aiostream>=0.7.1; extra ==
|
|
24
|
-
Requires-Dist: arize-phoenix-otel>=0.12.1; extra ==
|
|
25
|
-
Requires-Dist: boto3>=1.34.0; extra ==
|
|
26
|
-
Requires-Dist: datasets>=4.4.1; extra ==
|
|
27
|
-
Requires-Dist: diskcache>=5.6.3; extra ==
|
|
28
|
-
Requires-Dist: docling>=2.55.1; extra ==
|
|
29
|
-
Requires-Dist: docx2txt>=0.9; extra ==
|
|
30
|
-
Requires-Dist: fastapi>=0.116.1; extra ==
|
|
31
|
-
Requires-Dist: jsonpath-ng>=1.7.0; extra ==
|
|
32
|
-
Requires-Dist: langfuse>=3.9.0; extra ==
|
|
33
|
-
Requires-Dist: llama-index-embeddings-bedrock>=0.5.2; extra ==
|
|
34
|
-
Requires-Dist: llama-index-embeddings-openai>=0.3.1; extra ==
|
|
35
|
-
Requires-Dist: llama-index-llms-bedrock-converse>=0.10.5; extra ==
|
|
36
|
-
Requires-Dist: llama-index-llms-bedrock>=0.3.8; extra ==
|
|
37
|
-
Requires-Dist: llama-index-llms-vertex>=0.6.1; extra ==
|
|
38
|
-
Requires-Dist: llama-index-postprocessor-bedrock-rerank>=0.5.1; extra ==
|
|
39
|
-
Requires-Dist: llama-index-readers-huggingface-fs>=0.4.1; extra ==
|
|
40
|
-
Requires-Dist: llama-index-vector-stores-qdrant>=0.8.6; extra ==
|
|
41
|
-
Requires-Dist: llama-index>=0.12.45; extra ==
|
|
42
|
-
Requires-Dist: openinference-instrumentation-llama-index>=4.3.4; extra ==
|
|
43
|
-
Requires-Dist: opensearch-py>=2.7.0; extra ==
|
|
44
|
-
Requires-Dist: opentelemetry-exporter-otlp>=1.35.0; extra ==
|
|
45
|
-
Requires-Dist: opentelemetry-sdk>=1.35.0; extra ==
|
|
46
|
-
Requires-Dist: pandas>=2.2.3; extra ==
|
|
47
|
-
Requires-Dist: psycopg2-binary>=2.9.10; extra ==
|
|
48
|
-
Requires-Dist: pyarrow>=21.0.0; extra ==
|
|
49
|
-
Requires-Dist: pyathena[sqlalchemy]>=3.18.0; extra ==
|
|
50
|
-
Requires-Dist: python-magic>=0.4.27; extra ==
|
|
51
|
-
Requires-Dist: s3fs>=2025.7.0; extra ==
|
|
52
|
-
Requires-Dist: sqlalchemy>=2.0.42; extra ==
|
|
53
|
-
Requires-Dist: uvicorn[standard]>=0.35.0; extra ==
|
|
23
|
+
Requires-Dist: aiostream>=0.7.1; extra == 'interpreter'
|
|
24
|
+
Requires-Dist: arize-phoenix-otel>=0.12.1; extra == 'interpreter'
|
|
25
|
+
Requires-Dist: boto3>=1.34.0; extra == 'interpreter'
|
|
26
|
+
Requires-Dist: datasets>=4.4.1; extra == 'interpreter'
|
|
27
|
+
Requires-Dist: diskcache>=5.6.3; extra == 'interpreter'
|
|
28
|
+
Requires-Dist: docling>=2.55.1; extra == 'interpreter'
|
|
29
|
+
Requires-Dist: docx2txt>=0.9; extra == 'interpreter'
|
|
30
|
+
Requires-Dist: fastapi>=0.116.1; extra == 'interpreter'
|
|
31
|
+
Requires-Dist: jsonpath-ng>=1.7.0; extra == 'interpreter'
|
|
32
|
+
Requires-Dist: langfuse>=3.9.0; extra == 'interpreter'
|
|
33
|
+
Requires-Dist: llama-index-embeddings-bedrock>=0.5.2; extra == 'interpreter'
|
|
34
|
+
Requires-Dist: llama-index-embeddings-openai>=0.3.1; extra == 'interpreter'
|
|
35
|
+
Requires-Dist: llama-index-llms-bedrock-converse>=0.10.5; extra == 'interpreter'
|
|
36
|
+
Requires-Dist: llama-index-llms-bedrock>=0.3.8; extra == 'interpreter'
|
|
37
|
+
Requires-Dist: llama-index-llms-vertex>=0.6.1; extra == 'interpreter'
|
|
38
|
+
Requires-Dist: llama-index-postprocessor-bedrock-rerank>=0.5.1; extra == 'interpreter'
|
|
39
|
+
Requires-Dist: llama-index-readers-huggingface-fs>=0.4.1; extra == 'interpreter'
|
|
40
|
+
Requires-Dist: llama-index-vector-stores-qdrant>=0.8.6; extra == 'interpreter'
|
|
41
|
+
Requires-Dist: llama-index>=0.12.45; extra == 'interpreter'
|
|
42
|
+
Requires-Dist: openinference-instrumentation-llama-index>=4.3.4; extra == 'interpreter'
|
|
43
|
+
Requires-Dist: opensearch-py>=2.7.0; extra == 'interpreter'
|
|
44
|
+
Requires-Dist: opentelemetry-exporter-otlp>=1.35.0; extra == 'interpreter'
|
|
45
|
+
Requires-Dist: opentelemetry-sdk>=1.35.0; extra == 'interpreter'
|
|
46
|
+
Requires-Dist: pandas>=2.2.3; extra == 'interpreter'
|
|
47
|
+
Requires-Dist: psycopg2-binary>=2.9.10; extra == 'interpreter'
|
|
48
|
+
Requires-Dist: pyarrow>=21.0.0; extra == 'interpreter'
|
|
49
|
+
Requires-Dist: pyathena[sqlalchemy]>=3.18.0; extra == 'interpreter'
|
|
50
|
+
Requires-Dist: python-magic>=0.4.27; extra == 'interpreter'
|
|
51
|
+
Requires-Dist: s3fs>=2025.7.0; extra == 'interpreter'
|
|
52
|
+
Requires-Dist: sqlalchemy>=2.0.42; extra == 'interpreter'
|
|
53
|
+
Requires-Dist: uvicorn[standard]>=0.35.0; extra == 'interpreter'
|
|
54
54
|
Provides-Extra: mcp
|
|
55
|
-
Requires-Dist: httpx>=0.28.1; extra ==
|
|
56
|
-
Requires-Dist: mcp[cli]>=1.25.0; extra ==
|
|
57
|
-
|
|
55
|
+
Requires-Dist: httpx>=0.28.1; extra == 'mcp'
|
|
56
|
+
Requires-Dist: mcp[cli]>=1.25.0; extra == 'mcp'
|
|
57
|
+
Requires-Dist: tantivy>=0.25.1; extra == 'mcp'
|
|
58
|
+
Description-Content-Type: text/markdown
|
|
58
59
|
|
|
59
60
|
# QType
|
|
60
61
|
|
|
@@ -178,4 +179,4 @@ Stay tuned for upcoming features like:
|
|
|
178
179
|
Happy hacking with QType! 🛠️
|
|
179
180
|
|
|
180
181
|
|
|
181
|
-
[](https://github.com/bazaarvoice/qtype/actions/workflows/github_workflows_generate-schema.yml) [](https://github.com/bazaarvoice/qtype/actions/workflows/publish-pypi.yml)
|
|
182
|
+
[](https://github.com/bazaarvoice/qtype/actions/workflows/github_workflows_generate-schema.yml) [](https://github.com/bazaarvoice/qtype/actions/workflows/publish-pypi.yml)
|