Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 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
6 changes: 3 additions & 3 deletions ballerina/Ballerina.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
org = "ballerinax"
name = "np"
version = "0.8.0"
version = "0.8.1"
authors = ["Ballerina"]
keywords = ["natural programming", "ai"]
repository = "https://github.com/ballerina-platform/module-ballerinax-np"
Expand All @@ -17,5 +17,5 @@ observabilityIncluded = true
[[platform.java21.dependency]]
groupId = "io.ballerina.lib"
artifactId = "np-native"
version = "0.8.0"
path = "../native/build/libs/np-native-0.8.0.jar"
version = "0.8.1"
path = "../native/build/libs/np-native-0.8.1-SNAPSHOT.jar"
2 changes: 1 addition & 1 deletion ballerina/CompilerPlugin.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ id = "np-compiler-plugin"
class = "io.ballerina.lib.np.compilerplugin.CompilerPlugin"

[[dependency]]
path = "../compiler-plugin/build/libs/np-compiler-plugin-0.8.0.jar"
path = "../compiler-plugin/build/libs/np-compiler-plugin-0.8.1-SNAPSHOT.jar"
2 changes: 1 addition & 1 deletion ballerina/Dependencies.toml
Original file line number Diff line number Diff line change
Expand Up @@ -335,7 +335,7 @@ modules = [
[[package]]
org = "ballerinax"
name = "np"
version = "0.8.0"
version = "0.8.1"
dependencies = [
{org = "ballerina", name = "http"},
{org = "ballerina", name = "jballerina.java"},
Expand Down
4 changes: 2 additions & 2 deletions ballerina/main.bal
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

const JSON_CONVERSION_ERROR = "FromJsonStringError";
const CONVERSION_ERROR = "ConversionError";
const ERROR_MESSAGE = "Error occurred while converting the LLM response to the given type. Please refine your prompt to get a better result.";
const ERROR_MESSAGE = "Error occurred while converting the LLM response to the given type. This could happen if the response format is unexpected or contains invalid data.";

type DefaultModelConfig DefaultAzureOpenAIModelConfig|DefaultOpenAIModelConfig|DefaultBallerinaModelConfig;

Expand Down Expand Up @@ -119,7 +119,7 @@ isolated function parseResponseAsType(json resp, typedesc<json> targetType) retu
isolated function handlepParseResponseError(error chatResponseError) returns error {
if chatResponseError.message().includes(JSON_CONVERSION_ERROR)
|| chatResponseError.message().includes(CONVERSION_ERROR) {
return error(string `${ERROR_MESSAGE}`);
return error(string `${ERROR_MESSAGE}`, detail = chatResponseError);
}
return chatResponseError;
}
2 changes: 1 addition & 1 deletion ballerina/tests/tests.bal
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

import ballerina/test;

const ERROR_MESSAGE = "Error occurred while converting the LLM response to the given type. Please refine your prompt to get a better result.";
const ERROR_MESSAGE = "Error occurred while converting the LLM response to the given type. This could happen if the response format is unexpected or contains invalid data.";

@test:Config
function testPromptAsCodeFunctionWithSimpleExpectedTypeWithDefaultAzureOpenAIClient() returns error? {
Expand Down
Loading