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
|
@@ -1,289 +0,0 @@
|
|
|
1
|
-
auths:
|
|
2
|
-
- id: tavily-api_bearerauth_token
|
|
3
|
-
token: ${TAVILY-API_BEARER}
|
|
4
|
-
type: bearer_token
|
|
5
|
-
description: Tools created from API specification tavily.oas.yaml
|
|
6
|
-
flows: []
|
|
7
|
-
id: tavily-api
|
|
8
|
-
indexes: []
|
|
9
|
-
memories: []
|
|
10
|
-
models: []
|
|
11
|
-
references: []
|
|
12
|
-
tools:
|
|
13
|
-
- auth: tavily-api_bearerauth_token
|
|
14
|
-
description: 'Perform a web search with various filtering and customization options.
|
|
15
|
-
Returns search results with content, URLs, scores, and optional answers. '
|
|
16
|
-
endpoint: https://api.tavily.com/search
|
|
17
|
-
headers: {}
|
|
18
|
-
id: search
|
|
19
|
-
inputs:
|
|
20
|
-
auto_parameters:
|
|
21
|
-
optional: true
|
|
22
|
-
type: boolean
|
|
23
|
-
country:
|
|
24
|
-
optional: true
|
|
25
|
-
type: text
|
|
26
|
-
days:
|
|
27
|
-
optional: true
|
|
28
|
-
type: int
|
|
29
|
-
end_date:
|
|
30
|
-
optional: true
|
|
31
|
-
type: text
|
|
32
|
-
exclude_domains:
|
|
33
|
-
optional: true
|
|
34
|
-
type:
|
|
35
|
-
element_type: text
|
|
36
|
-
include_answer:
|
|
37
|
-
optional: true
|
|
38
|
-
type: text
|
|
39
|
-
include_domains:
|
|
40
|
-
optional: true
|
|
41
|
-
type:
|
|
42
|
-
element_type: text
|
|
43
|
-
include_favicon:
|
|
44
|
-
optional: true
|
|
45
|
-
type: boolean
|
|
46
|
-
include_images:
|
|
47
|
-
optional: true
|
|
48
|
-
type: boolean
|
|
49
|
-
include_raw_content:
|
|
50
|
-
optional: true
|
|
51
|
-
type: text
|
|
52
|
-
max_results:
|
|
53
|
-
optional: true
|
|
54
|
-
type: int
|
|
55
|
-
query:
|
|
56
|
-
optional: false
|
|
57
|
-
type: text
|
|
58
|
-
search_depth:
|
|
59
|
-
optional: true
|
|
60
|
-
type: text
|
|
61
|
-
start_date:
|
|
62
|
-
optional: true
|
|
63
|
-
type: text
|
|
64
|
-
time_range:
|
|
65
|
-
optional: true
|
|
66
|
-
type: text
|
|
67
|
-
topic:
|
|
68
|
-
optional: true
|
|
69
|
-
type: text
|
|
70
|
-
method: POST
|
|
71
|
-
name: Search the web
|
|
72
|
-
outputs:
|
|
73
|
-
answer:
|
|
74
|
-
optional: true
|
|
75
|
-
type: text
|
|
76
|
-
follow_up_questions:
|
|
77
|
-
optional: true
|
|
78
|
-
type:
|
|
79
|
-
element_type: text
|
|
80
|
-
images:
|
|
81
|
-
optional: true
|
|
82
|
-
type:
|
|
83
|
-
element_type: schema_4844015520
|
|
84
|
-
query:
|
|
85
|
-
optional: true
|
|
86
|
-
type: text
|
|
87
|
-
response_time:
|
|
88
|
-
optional: true
|
|
89
|
-
type: float
|
|
90
|
-
results:
|
|
91
|
-
optional: true
|
|
92
|
-
type:
|
|
93
|
-
element_type: schema_4844016144
|
|
94
|
-
parameters: {}
|
|
95
|
-
type: APITool
|
|
96
|
-
- auth: tavily-api_bearerauth_token
|
|
97
|
-
description: 'Extract and process content from one or more URLs with various formatting
|
|
98
|
-
options. Returns extracted content in text or markdown format. '
|
|
99
|
-
endpoint: https://api.tavily.com/extract
|
|
100
|
-
headers: {}
|
|
101
|
-
id: extract
|
|
102
|
-
inputs:
|
|
103
|
-
extract_depth:
|
|
104
|
-
optional: true
|
|
105
|
-
type: text
|
|
106
|
-
format:
|
|
107
|
-
optional: true
|
|
108
|
-
type: text
|
|
109
|
-
include_favicon:
|
|
110
|
-
optional: true
|
|
111
|
-
type: boolean
|
|
112
|
-
include_images:
|
|
113
|
-
optional: true
|
|
114
|
-
type: boolean
|
|
115
|
-
urls:
|
|
116
|
-
optional: false
|
|
117
|
-
type:
|
|
118
|
-
element_type: text
|
|
119
|
-
method: POST
|
|
120
|
-
name: Extract content from URLs
|
|
121
|
-
outputs:
|
|
122
|
-
failed_results:
|
|
123
|
-
optional: true
|
|
124
|
-
type:
|
|
125
|
-
element_type: schema_4844027472
|
|
126
|
-
results:
|
|
127
|
-
optional: true
|
|
128
|
-
type:
|
|
129
|
-
element_type: schema_4844024880
|
|
130
|
-
parameters: {}
|
|
131
|
-
type: APITool
|
|
132
|
-
- auth: tavily-api_bearerauth_token
|
|
133
|
-
description: 'Crawl a website starting from a given URL with depth and breadth controls.
|
|
134
|
-
Extract content from discovered pages with various filtering options. '
|
|
135
|
-
endpoint: https://api.tavily.com/crawl
|
|
136
|
-
headers: {}
|
|
137
|
-
id: crawl
|
|
138
|
-
inputs:
|
|
139
|
-
allow_external:
|
|
140
|
-
optional: true
|
|
141
|
-
type: boolean
|
|
142
|
-
exclude_domains:
|
|
143
|
-
optional: true
|
|
144
|
-
type:
|
|
145
|
-
element_type: text
|
|
146
|
-
exclude_paths:
|
|
147
|
-
optional: true
|
|
148
|
-
type:
|
|
149
|
-
element_type: text
|
|
150
|
-
extract_depth:
|
|
151
|
-
optional: true
|
|
152
|
-
type: text
|
|
153
|
-
format:
|
|
154
|
-
optional: true
|
|
155
|
-
type: text
|
|
156
|
-
include_favicon:
|
|
157
|
-
optional: true
|
|
158
|
-
type: boolean
|
|
159
|
-
include_images:
|
|
160
|
-
optional: true
|
|
161
|
-
type: boolean
|
|
162
|
-
instructions:
|
|
163
|
-
optional: true
|
|
164
|
-
type: text
|
|
165
|
-
limit:
|
|
166
|
-
optional: true
|
|
167
|
-
type: int
|
|
168
|
-
max_breadth:
|
|
169
|
-
optional: true
|
|
170
|
-
type: int
|
|
171
|
-
max_depth:
|
|
172
|
-
optional: true
|
|
173
|
-
type: int
|
|
174
|
-
select_domains:
|
|
175
|
-
optional: true
|
|
176
|
-
type:
|
|
177
|
-
element_type: text
|
|
178
|
-
select_paths:
|
|
179
|
-
optional: true
|
|
180
|
-
type:
|
|
181
|
-
element_type: text
|
|
182
|
-
url:
|
|
183
|
-
optional: false
|
|
184
|
-
type: text
|
|
185
|
-
method: POST
|
|
186
|
-
name: Crawl websites
|
|
187
|
-
outputs:
|
|
188
|
-
results:
|
|
189
|
-
optional: true
|
|
190
|
-
type:
|
|
191
|
-
element_type: schema_4844408352
|
|
192
|
-
parameters: {}
|
|
193
|
-
type: APITool
|
|
194
|
-
- auth: tavily-api_bearerauth_token
|
|
195
|
-
description: "Map the structure and links of a website starting from a given URL.
|
|
196
|
-
Discover the website's architecture and page hierarchy. "
|
|
197
|
-
endpoint: https://api.tavily.com/map
|
|
198
|
-
headers: {}
|
|
199
|
-
id: map
|
|
200
|
-
inputs:
|
|
201
|
-
allow_external:
|
|
202
|
-
optional: true
|
|
203
|
-
type: boolean
|
|
204
|
-
exclude_domains:
|
|
205
|
-
optional: true
|
|
206
|
-
type:
|
|
207
|
-
element_type: text
|
|
208
|
-
exclude_paths:
|
|
209
|
-
optional: true
|
|
210
|
-
type:
|
|
211
|
-
element_type: text
|
|
212
|
-
include_images:
|
|
213
|
-
optional: true
|
|
214
|
-
type: boolean
|
|
215
|
-
instructions:
|
|
216
|
-
optional: true
|
|
217
|
-
type: text
|
|
218
|
-
limit:
|
|
219
|
-
optional: true
|
|
220
|
-
type: int
|
|
221
|
-
max_breadth:
|
|
222
|
-
optional: true
|
|
223
|
-
type: int
|
|
224
|
-
max_depth:
|
|
225
|
-
optional: true
|
|
226
|
-
type: int
|
|
227
|
-
select_domains:
|
|
228
|
-
optional: true
|
|
229
|
-
type:
|
|
230
|
-
element_type: text
|
|
231
|
-
select_paths:
|
|
232
|
-
optional: true
|
|
233
|
-
type:
|
|
234
|
-
element_type: text
|
|
235
|
-
url:
|
|
236
|
-
optional: false
|
|
237
|
-
type: text
|
|
238
|
-
method: POST
|
|
239
|
-
name: Map website structure
|
|
240
|
-
outputs:
|
|
241
|
-
results:
|
|
242
|
-
optional: true
|
|
243
|
-
type:
|
|
244
|
-
element_type: schema_4844415936
|
|
245
|
-
parameters: {}
|
|
246
|
-
type: APITool
|
|
247
|
-
types:
|
|
248
|
-
- description: Generated from OpenAPI schema
|
|
249
|
-
id: schema_4844015520
|
|
250
|
-
properties:
|
|
251
|
-
alt_text: text?
|
|
252
|
-
title: text?
|
|
253
|
-
url: text?
|
|
254
|
-
- description: Generated from OpenAPI schema
|
|
255
|
-
id: schema_4844016144
|
|
256
|
-
properties:
|
|
257
|
-
content: text?
|
|
258
|
-
favicon: text?
|
|
259
|
-
raw_content: text?
|
|
260
|
-
score: float?
|
|
261
|
-
title: text?
|
|
262
|
-
url: text?
|
|
263
|
-
- description: Generated from OpenAPI schema
|
|
264
|
-
id: schema_4844024880
|
|
265
|
-
properties:
|
|
266
|
-
content: text?
|
|
267
|
-
favicon: text?
|
|
268
|
-
title: text?
|
|
269
|
-
url: text?
|
|
270
|
-
- description: Generated from OpenAPI schema
|
|
271
|
-
id: schema_4844027472
|
|
272
|
-
properties:
|
|
273
|
-
error: text?
|
|
274
|
-
url: text?
|
|
275
|
-
- description: Generated from OpenAPI schema
|
|
276
|
-
id: schema_4844408352
|
|
277
|
-
properties:
|
|
278
|
-
content: text?
|
|
279
|
-
favicon: text?
|
|
280
|
-
links: list[text]?
|
|
281
|
-
title: text?
|
|
282
|
-
url: text?
|
|
283
|
-
- description: Generated from OpenAPI schema
|
|
284
|
-
id: schema_4844415936
|
|
285
|
-
properties:
|
|
286
|
-
depth: int?
|
|
287
|
-
links: list[text]?
|
|
288
|
-
title: text?
|
|
289
|
-
url: text?
|
qtype/application/facade.py
DELETED
|
@@ -1,177 +0,0 @@
|
|
|
1
|
-
"""Main facade for qtype operations."""
|
|
2
|
-
|
|
3
|
-
from __future__ import annotations
|
|
4
|
-
|
|
5
|
-
import logging
|
|
6
|
-
from pathlib import Path
|
|
7
|
-
from typing import Any
|
|
8
|
-
|
|
9
|
-
from qtype.base.types import PathLike
|
|
10
|
-
from qtype.semantic.model import Application as SemanticApplication
|
|
11
|
-
from qtype.semantic.model import DocumentType as SemanticDocumentType
|
|
12
|
-
|
|
13
|
-
# Note: There should be _zero_ imports here at the top that import qtype.interpreter.
|
|
14
|
-
# That's the whole point of this facade - to avoid importing optional
|
|
15
|
-
# dependencies unless these methods are called.
|
|
16
|
-
|
|
17
|
-
logger = logging.getLogger(__name__)
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
class QTypeFacade:
|
|
21
|
-
"""
|
|
22
|
-
Simplified interface for qtype operations.
|
|
23
|
-
|
|
24
|
-
This facade provides lazy-loading wrappers for operations that require
|
|
25
|
-
optional dependencies (interpreter package), allowing base qtype to work
|
|
26
|
-
without those dependencies installed.
|
|
27
|
-
"""
|
|
28
|
-
|
|
29
|
-
def telemetry(self, spec: SemanticDocumentType) -> None:
|
|
30
|
-
from qtype.interpreter.telemetry import register
|
|
31
|
-
|
|
32
|
-
if isinstance(spec, SemanticApplication) and spec.telemetry:
|
|
33
|
-
logger.info(
|
|
34
|
-
f"Telemetry enabled with endpoint: {spec.telemetry.endpoint}"
|
|
35
|
-
)
|
|
36
|
-
# Register telemetry if needed
|
|
37
|
-
register(spec.telemetry, self.secret_manager(spec), spec.id)
|
|
38
|
-
|
|
39
|
-
def secret_manager(self, spec: SemanticDocumentType):
|
|
40
|
-
"""
|
|
41
|
-
Create a secret manager based on the specification.
|
|
42
|
-
|
|
43
|
-
Args:
|
|
44
|
-
spec: SemanticDocumentType specification
|
|
45
|
-
|
|
46
|
-
Returns:
|
|
47
|
-
Secret manager instance
|
|
48
|
-
"""
|
|
49
|
-
from qtype.interpreter.base.secrets import create_secret_manager
|
|
50
|
-
|
|
51
|
-
if isinstance(spec, SemanticApplication):
|
|
52
|
-
return create_secret_manager(spec.secret_manager)
|
|
53
|
-
else:
|
|
54
|
-
raise ValueError(
|
|
55
|
-
"Can't create secret manager for non-Application spec"
|
|
56
|
-
)
|
|
57
|
-
|
|
58
|
-
async def execute_workflow(
|
|
59
|
-
self,
|
|
60
|
-
path: PathLike,
|
|
61
|
-
inputs: dict | Any,
|
|
62
|
-
flow_name: str | None = None,
|
|
63
|
-
**kwargs: Any,
|
|
64
|
-
) -> Any:
|
|
65
|
-
"""
|
|
66
|
-
Execute a complete workflow from document to results.
|
|
67
|
-
|
|
68
|
-
Args:
|
|
69
|
-
path: Path to the QType specification file
|
|
70
|
-
inputs: Dictionary of input values or DataFrame for batch
|
|
71
|
-
flow_name: Optional name of flow to execute
|
|
72
|
-
**kwargs: Additional dependencies for execution
|
|
73
|
-
|
|
74
|
-
Returns:
|
|
75
|
-
DataFrame with results (one row per input)
|
|
76
|
-
"""
|
|
77
|
-
import pandas as pd
|
|
78
|
-
from opentelemetry import trace
|
|
79
|
-
|
|
80
|
-
from qtype.interpreter.base.executor_context import ExecutorContext
|
|
81
|
-
from qtype.interpreter.converters import (
|
|
82
|
-
dataframe_to_flow_messages,
|
|
83
|
-
flow_messages_to_dataframe,
|
|
84
|
-
)
|
|
85
|
-
from qtype.interpreter.flow import run_flow
|
|
86
|
-
from qtype.interpreter.types import Session
|
|
87
|
-
from qtype.semantic.loader import load
|
|
88
|
-
|
|
89
|
-
# Load the semantic application
|
|
90
|
-
semantic_model, type_registry = load(Path(path))
|
|
91
|
-
assert isinstance(semantic_model, SemanticApplication)
|
|
92
|
-
self.telemetry(semantic_model)
|
|
93
|
-
|
|
94
|
-
# Find the flow to execute
|
|
95
|
-
if flow_name:
|
|
96
|
-
target_flow = None
|
|
97
|
-
for flow in semantic_model.flows:
|
|
98
|
-
if flow.id == flow_name:
|
|
99
|
-
target_flow = flow
|
|
100
|
-
break
|
|
101
|
-
if target_flow is None:
|
|
102
|
-
raise ValueError(f"Flow '{flow_name}' not found")
|
|
103
|
-
else:
|
|
104
|
-
if semantic_model.flows:
|
|
105
|
-
target_flow = semantic_model.flows[0]
|
|
106
|
-
else:
|
|
107
|
-
raise ValueError("No flows found in application")
|
|
108
|
-
|
|
109
|
-
logger.info(f"Executing flow {target_flow.id} from {path}")
|
|
110
|
-
|
|
111
|
-
# Convert inputs to DataFrame (normalize single dict to 1-row DataFrame)
|
|
112
|
-
|
|
113
|
-
if isinstance(inputs, dict):
|
|
114
|
-
input_df = pd.DataFrame([inputs])
|
|
115
|
-
elif isinstance(inputs, pd.DataFrame):
|
|
116
|
-
input_df = inputs
|
|
117
|
-
else:
|
|
118
|
-
raise ValueError(
|
|
119
|
-
f"Inputs must be dict or DataFrame, got {type(inputs)}"
|
|
120
|
-
)
|
|
121
|
-
|
|
122
|
-
# Create session
|
|
123
|
-
session = Session(
|
|
124
|
-
session_id=kwargs.pop("session_id", "default"),
|
|
125
|
-
conversation_history=kwargs.pop("conversation_history", []),
|
|
126
|
-
)
|
|
127
|
-
|
|
128
|
-
# Convert DataFrame to FlowMessages
|
|
129
|
-
initial_messages = dataframe_to_flow_messages(input_df, session)
|
|
130
|
-
|
|
131
|
-
# Execute the flow
|
|
132
|
-
secret_manager = self.secret_manager(semantic_model)
|
|
133
|
-
|
|
134
|
-
context = ExecutorContext(
|
|
135
|
-
secret_manager=secret_manager,
|
|
136
|
-
tracer=trace.get_tracer(__name__),
|
|
137
|
-
)
|
|
138
|
-
results = await run_flow(
|
|
139
|
-
target_flow,
|
|
140
|
-
initial_messages,
|
|
141
|
-
context=context,
|
|
142
|
-
**kwargs,
|
|
143
|
-
)
|
|
144
|
-
|
|
145
|
-
# Convert results back to DataFrame
|
|
146
|
-
results_df = flow_messages_to_dataframe(results, target_flow)
|
|
147
|
-
|
|
148
|
-
return results_df
|
|
149
|
-
|
|
150
|
-
def generate_aws_bedrock_models(self) -> list[dict[str, Any]]:
|
|
151
|
-
"""
|
|
152
|
-
Generate AWS Bedrock model definitions.
|
|
153
|
-
|
|
154
|
-
Returns:
|
|
155
|
-
List of model definitions for AWS Bedrock models.
|
|
156
|
-
|
|
157
|
-
Raises:
|
|
158
|
-
ImportError: If boto3 is not installed.
|
|
159
|
-
Exception: If AWS API call fails.
|
|
160
|
-
"""
|
|
161
|
-
import boto3 # type: ignore[import-untyped]
|
|
162
|
-
|
|
163
|
-
logger.info("Discovering AWS Bedrock models...")
|
|
164
|
-
client = boto3.client("bedrock")
|
|
165
|
-
models = client.list_foundation_models()
|
|
166
|
-
|
|
167
|
-
model_definitions = []
|
|
168
|
-
for model_summary in models.get("modelSummaries", []):
|
|
169
|
-
model_definitions.append(
|
|
170
|
-
{
|
|
171
|
-
"id": model_summary["modelId"],
|
|
172
|
-
"provider": "aws-bedrock",
|
|
173
|
-
}
|
|
174
|
-
)
|
|
175
|
-
|
|
176
|
-
logger.info(f"Discovered {len(model_definitions)} AWS Bedrock models")
|
|
177
|
-
return model_definitions
|