This commit is contained in:
narawat lamaiin
2024-07-07 20:59:12 +07:00
parent 0a7c2e15bf
commit d715b0c22d
2 changed files with 38 additions and 12 deletions

View File

@@ -4,15 +4,15 @@ using FormatCorrector
incorrectjson = "{\n \"explain\": \"The user is asking for information about wines that can be paired with lamb. This seems like a straightforward question, but it's not clear which database tables will contain the relevant information. I'll start by listing all available tables to see if any of them have columns related to wine and food pairing.\",\n \"plan\":\n \"1) List all tables in the database using 'listalltables',\n 2) Check each table for columns related to wine and food pairing\",\n \"action\": {\"name\": \"listalltables\", \"input\": \"\"},\n \"expectation\": \"A list of all available tables in the database, which will help me identify potential tables that might contain relevant information.\",\n \"observation\": \"\"\n}"
# incorrectjson = "{\"t\":5}"
context =
expectJSON =
"""
Here is an expected JSON format:
{
"explain": ...,
"plan": ...,
"action": {"name": ..., "input": ...},
"expectation": ...,
"observation": ...
explain: ...,
plan: ...,
action: {name: ..., input: ...},
expectation: ...,
observation: ...
}
"""
@@ -31,7 +31,7 @@ config = Dict(
)
)
result = FormatCorrector.jsoncorrection(config, incorrectjson, context)
result = FormatCorrector.jsoncorrection(config, incorrectjson, expectJSON)
println(result)