@fonoster/sdk 0.15.1 → 0.15.3

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.
Files changed (2) hide show
  1. package/README.md +70 -0
  2. package/package.json +4 -4
package/README.md CHANGED
@@ -711,6 +711,7 @@ Note that an active Fonoster deployment is required.
711
711
  * [.updateApplication(request)](#Applications+updateApplication) ⇒ <code>Promise.&lt;BaseApiObject&gt;</code>
712
712
  * [.listApplications(request)](#Applications+listApplications) ⇒ <code>Promise.&lt;ListApplicationsResponse&gt;</code>
713
713
  * [.deleteApplication(ref)](#Applications+deleteApplication) ⇒ <code>Promise.&lt;BaseApiObject&gt;</code>
714
+ * [.evaluateIntelligence(request)](#Applications+evaluateIntelligence) ⇒ <code>Promise.&lt;ScenarioEvaluationReport&gt;</code>
714
715
 
715
716
  <a name="new_Applications_new"></a>
716
717
 
@@ -930,6 +931,75 @@ apps
930
931
  .then(console.log) // successful response
931
932
  .catch(console.error); // an error occurred
932
933
  ```
934
+ <a name="Applications+evaluateIntelligence"></a>
935
+
936
+ ### applications.evaluateIntelligence(request) ⇒ <code>Promise.&lt;ScenarioEvaluationReport&gt;</code>
937
+ Evaluates the intelligence of an application.
938
+
939
+ **Kind**: instance method of [<code>Applications</code>](#Applications)
940
+ **Returns**: <code>Promise.&lt;ScenarioEvaluationReport&gt;</code> - - The response object that contains the evaluation report
941
+
942
+ | Param | Type | Description |
943
+ | --- | --- | --- |
944
+ | request | <code>EvaluateIntelligenceRequest</code> | The request object that contains the necessary information to evaluate the intelligence of an application |
945
+ | request.intelligence.productRef | <code>string</code> | The product reference of the intelligence engine (e.g., llm.groq) |
946
+ | request.intelligence.config | <code>object</code> | The configuration object for the intelligence engine |
947
+
948
+ **Example**
949
+ ```js
950
+ const apps = new SDK.Applications(client); // Existing client object
951
+
952
+ const request = {
953
+ intelligence: {
954
+ productRef: "llm.groq",
955
+ config: {
956
+ conversationSettings: {
957
+ firstMessage: "Hello, how can I help you today?",
958
+ systemPrompt: "You are a helpful assistant.",
959
+ systemErrorMessage: "I'm sorry, I didn't catch that. Can you say that again?",
960
+ goodbyeMessage: "Thank you for calling. Have a great day!",
961
+ languageModel: {
962
+ provider: "openai",
963
+ model: "gpt-4o"
964
+ },
965
+ testCases: {
966
+ evalsLanguageModel: {
967
+ provider: "openai",
968
+ model: "gpt-4o"
969
+ },
970
+ scenarios: [
971
+ {
972
+ ref: "Scenario 1",
973
+ description: "Scenario 1 description",
974
+ telephonyContext: {
975
+ callDirection: "FROM_PSTN",
976
+ ingressNumber: "1234567890",
977
+ callerNumber: "1234567890"
978
+ },
979
+ conversation: [
980
+ {
981
+ userInput: "Hello, how can I help you today?",
982
+ expected: {
983
+ text: {
984
+ type: "EXACT",
985
+ response: "Hello, how can I help you today?"
986
+ }
987
+ }
988
+ }
989
+ ]
990
+ }
991
+ ]
992
+ }
993
+ }
994
+ }
995
+ }
996
+ };
997
+
998
+ apps
999
+ .evaluateIntelligence(request)
1000
+ .then(console.log) // successful response
1001
+ .catch(console.error); // an error occurred
1002
+ ```
933
1003
 
934
1004
  <a name="Calls"></a>
935
1005
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fonoster/sdk",
3
- "version": "0.15.1",
3
+ "version": "0.15.3",
4
4
  "description": "Web and Node.js SDK for Fonoster",
5
5
  "author": "Pedro Sanders <psanders@fonoster.com>",
6
6
  "homepage": "https://github.com/fonoster/fonoster#readme",
@@ -26,8 +26,8 @@
26
26
  "fonoster"
27
27
  ],
28
28
  "dependencies": {
29
- "@fonoster/common": "^0.15.1",
30
- "@fonoster/types": "^0.15.1",
29
+ "@fonoster/common": "^0.15.3",
30
+ "@fonoster/types": "^0.15.3",
31
31
  "@grpc/grpc-js": "~1.10.6",
32
32
  "@grpc/proto-loader": "^0.7.12",
33
33
  "google-protobuf": "^3.21.2",
@@ -62,5 +62,5 @@
62
62
  "rollup": "^4.18.0",
63
63
  "serve": "^14.2.3"
64
64
  },
65
- "gitHead": "4e27c619e3b47300465b5f0ba0036d397aef2b17"
65
+ "gitHead": "eb958cbcc82a4862b30051515f3a6e9c72e8524b"
66
66
  }