Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Llama Index
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
mirrored_repos
MachineLearning
run-llama
Llama Index
Commits
720959a9
Unverified
Commit
720959a9
authored
1 year ago
by
Phuc Van Phan
Committed by
GitHub
1 year ago
Browse files
Options
Downloads
Patches
Plain Diff
fix: add postpreprocess_output_processor to json_query.py (#11862)
parent
62e1545e
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
llama-index-core/llama_index/core/indices/struct_store/json_query.py
+3
-0
3 additions, 0 deletions
...-core/llama_index/core/indices/struct_store/json_query.py
with
3 additions
and
0 deletions
llama-index-core/llama_index/core/indices/struct_store/json_query.py
+
3
−
0
View file @
720959a9
...
...
@@ -63,6 +63,9 @@ def default_output_response_parser(llm_output: str) -> str:
def
default_output_processor
(
llm_output
:
str
,
json_value
:
JSONType
)
->
JSONType
:
"""
Default output processor that extracts values based on JSON Path expressions.
"""
# Post-process the LLM output to remove the JSONPath: prefix
llm_output
=
llm_output
.
replace
(
"
JSONPath:
"
,
""
).
replace
(
"
JSON Path:
"
,
""
).
strip
()
# Split the given string into separate JSON Path expressions
expressions
=
[
expr
.
strip
()
for
expr
in
llm_output
.
split
(
"
,
"
)]
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment