Skip to content
Open
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -318,45 +318,55 @@ def frame_export_json(
if not prompt.profile_manager:
prompt.profile_manager = default_llm_profile

# Single-pass execution always runs prompts via the tool's
Comment thread
pk-zipstack marked this conversation as resolved.
Outdated
# default profile (see
# OutputManagerHelper.handle_prompt_output_update). Both
# validation lookup AND the per-prompt export payload must
# therefore source their settings from the default profile in
# single-pass mode — otherwise the exported tool would embed
# the stale prompt-level profile and the validation lookup
# would miss the rows actually produced by the run.
if tool.single_pass_extraction_mode:
output_profile = default_llm_profile
else:
output_profile = prompt.profile_manager

if not force_export:
prompt_output = PromptStudioOutputManager.objects.filter(
tool_id=tool.tool_id,
prompt_id=prompt.prompt_id,
profile_manager=prompt.profile_manager,
profile_manager=output_profile,
is_single_pass_extract=tool.single_pass_extraction_mode,
).all()
if not prompt_output:
invalidated_outputs.append(prompt.prompt_key)
continue

vector_db = str(prompt.profile_manager.vector_store.id)
embedding_model = str(prompt.profile_manager.embedding_model.id)
llm = str(prompt.profile_manager.llm.id)
x2text = str(prompt.profile_manager.x2text.id)
adapter_id = str(prompt.profile_manager.embedding_model.adapter_id)
vector_db = str(output_profile.vector_store.id)
embedding_model = str(output_profile.embedding_model.id)
llm = str(output_profile.llm.id)
x2text = str(output_profile.x2text.id)
adapter_id = str(output_profile.embedding_model.adapter_id)
embedding_suffix = adapter_id.split("|")[0]

output[JsonSchemaKey.PROMPT] = prompt.prompt
output[JsonSchemaKey.ACTIVE] = prompt.active
output[JsonSchemaKey.REQUIRED] = prompt.required
output[JsonSchemaKey.CHUNK_SIZE] = prompt.profile_manager.chunk_size
output[JsonSchemaKey.CHUNK_SIZE] = output_profile.chunk_size
output[JsonSchemaKey.VECTOR_DB] = vector_db
output[JsonSchemaKey.EMBEDDING] = embedding_model
output[JsonSchemaKey.X2TEXT_ADAPTER] = x2text
output[JsonSchemaKey.CHUNK_OVERLAP] = prompt.profile_manager.chunk_overlap
output[JsonSchemaKey.CHUNK_OVERLAP] = output_profile.chunk_overlap
output[JsonSchemaKey.LLM] = llm
output[JsonSchemaKey.PREAMBLE] = tool.preamble
output[JsonSchemaKey.POSTAMBLE] = tool.postamble
output[JsonSchemaKey.GRAMMAR] = grammar_list
output[JsonSchemaKey.TYPE] = prompt.enforce_type
output[JsonSchemaKey.NAME] = prompt.prompt_key
output[JsonSchemaKey.RETRIEVAL_STRATEGY] = (
prompt.profile_manager.retrieval_strategy
)
output[JsonSchemaKey.SIMILARITY_TOP_K] = (
prompt.profile_manager.similarity_top_k
)
output[JsonSchemaKey.SECTION] = prompt.profile_manager.section
output[JsonSchemaKey.REINDEX] = prompt.profile_manager.reindex
output[JsonSchemaKey.RETRIEVAL_STRATEGY] = output_profile.retrieval_strategy
output[JsonSchemaKey.SIMILARITY_TOP_K] = output_profile.similarity_top_k
output[JsonSchemaKey.SECTION] = output_profile.section
output[JsonSchemaKey.REINDEX] = output_profile.reindex
output[JsonSchemaKey.EMBEDDING_SUFFIX] = embedding_suffix
# Webhook postprocessing settings
output[JsonSchemaKey.ENABLE_POSTPROCESSING_WEBHOOK] = (
Expand Down
Empty file.
Loading