Skip to content

Commit 495726a

Browse files
authored
Resolve VCSWP-23198 (#55)
* Add new KnowledgeBase api code to SDK * Add changelog entry * Resolve dependabot alerts * Regenerate SDK after version and openapi spec file updates * Changes made to openapi spec * Update openapi spec in sdk
1 parent 2c35359 commit 495726a

25 files changed

+1115
-20
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,3 +69,4 @@ target/
6969
.DS_Store
7070
freeclimb/.DS_Store
7171
git_push.sh
72+
/node_modules

.openapi-generator/FILES

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@ docs/CallResult.md
2323
docs/CallResultAllOf.md
2424
docs/CallStatus.md
2525
docs/Capabilities.md
26+
docs/CompletionRequest.md
27+
docs/CompletionResult.md
2628
docs/ConferenceList.md
2729
docs/ConferenceListAllOf.md
2830
docs/ConferenceParticipantList.md
@@ -175,6 +177,8 @@ freeclimb/model/call_result.py
175177
freeclimb/model/call_result_all_of.py
176178
freeclimb/model/call_status.py
177179
freeclimb/model/capabilities.py
180+
freeclimb/model/completion_request.py
181+
freeclimb/model/completion_result.py
178182
freeclimb/model/conference_list.py
179183
freeclimb/model/conference_list_all_of.py
180184
freeclimb/model/conference_participant_list.py

CHANGELOG.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,14 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm
99

1010
None
1111

12+
<a name="4.8.0"></a>
13+
14+
## [4.8.0] - 2024-10-08
15+
16+
### Added
17+
18+
- Add KnowledgeBase API to SDK
19+
1220
<a name="4.7.0"></a>
1321

1422
## [4.7.0] - 2024-09-12

README.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ FreeClimb is a cloud-based application programming interface (API) that puts the
44
This Python package is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project:
55

66
- API version: 1.0.0
7-
- Package version: 4.7.0
7+
- Package version: 4.8.0
88
- Build package: org.openapitools.codegen.languages.PythonClientCodegen
99
For more information, please visit [https://www.freeclimb.com/support/](https://www.freeclimb.com/support/)
1010

@@ -131,6 +131,7 @@ Class | Method | HTTP request | Description
131131
*DefaultApi* | [**create_a_conference**](docs/DefaultApi.md#create_a_conference) | **POST** /Accounts/{accountId}/Conferences | Create a Conference
132132
*DefaultApi* | [**create_a_queue**](docs/DefaultApi.md#create_a_queue) | **POST** /Accounts/{accountId}/Queues | Create a Queue
133133
*DefaultApi* | [**create_an_application**](docs/DefaultApi.md#create_an_application) | **POST** /Accounts/{accountId}/Applications | Create an application
134+
*DefaultApi* | [**create_knowledge_base_completion**](docs/DefaultApi.md#create_knowledge_base_completion) | **POST** /Accounts/{accountId}/KnowledgeBases/{knowledgeBaseId}/Completion | Query the knowledge base
134135
*DefaultApi* | [**delete_a_recording**](docs/DefaultApi.md#delete_a_recording) | **DELETE** /Accounts/{accountId}/Recordings/{recordingId} | Delete a Recording
135136
*DefaultApi* | [**delete_an_application**](docs/DefaultApi.md#delete_an_application) | **DELETE** /Accounts/{accountId}/Applications/{applicationId} | Delete an application
136137
*DefaultApi* | [**delete_an_incoming_number**](docs/DefaultApi.md#delete_an_incoming_number) | **DELETE** /Accounts/{accountId}/IncomingPhoneNumbers/{phoneNumberId} | Delete an Incoming Number
@@ -211,6 +212,8 @@ Class | Method | HTTP request | Description
211212
- [CallResultAllOf](docs/CallResultAllOf.md)
212213
- [CallStatus](docs/CallStatus.md)
213214
- [Capabilities](docs/Capabilities.md)
215+
- [CompletionRequest](docs/CompletionRequest.md)
216+
- [CompletionResult](docs/CompletionResult.md)
214217
- [ConferenceList](docs/ConferenceList.md)
215218
- [ConferenceListAllOf](docs/ConferenceListAllOf.md)
216219
- [ConferenceParticipantList](docs/ConferenceParticipantList.md)

docs/CompletionRequest.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# CompletionRequest
2+
3+
## Properties
4+
Name | Type | Description | Notes
5+
------------ | ------------- | ------------- | -------------
6+
**query** | **str** | Question to ask the Knowledge Base |
7+
8+
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
9+
10+

docs/CompletionResult.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# CompletionResult
2+
3+
## Properties
4+
Name | Type | Description | Notes
5+
------------ | ------------- | ------------- | -------------
6+
**response** | **str** | The generative response from the KnowledgeBase |
7+
**status** | **str** | Completion result status. Possible values: success, no_context |
8+
9+
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
10+
11+

docs/DefaultApi.md

Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ Method | HTTP request | Description
88
[**create_a_conference**](DefaultApi.md#create_a_conference) | **POST** /Accounts/{accountId}/Conferences | Create a Conference
99
[**create_a_queue**](DefaultApi.md#create_a_queue) | **POST** /Accounts/{accountId}/Queues | Create a Queue
1010
[**create_an_application**](DefaultApi.md#create_an_application) | **POST** /Accounts/{accountId}/Applications | Create an application
11+
[**create_knowledge_base_completion**](DefaultApi.md#create_knowledge_base_completion) | **POST** /Accounts/{accountId}/KnowledgeBases/{knowledgeBaseId}/Completion | Query the knowledge base
1112
[**delete_a_recording**](DefaultApi.md#delete_a_recording) | **DELETE** /Accounts/{accountId}/Recordings/{recordingId} | Delete a Recording
1213
[**delete_an_application**](DefaultApi.md#delete_an_application) | **DELETE** /Accounts/{accountId}/Applications/{applicationId} | Delete an application
1314
[**delete_an_incoming_number**](DefaultApi.md#delete_an_incoming_number) | **DELETE** /Accounts/{accountId}/IncomingPhoneNumbers/{phoneNumberId} | Delete an Incoming Number
@@ -422,6 +423,97 @@ Name | Type | Description | Notes
422423

423424
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
424425

426+
# **create_knowledge_base_completion**
427+
> CompletionResult create_knowledge_base_completion(account_id, knowledge_base_id)
428+
429+
Query the knowledge base
430+
431+
### Example
432+
433+
* Basic Authentication (fc):
434+
435+
```python
436+
import time
437+
import freeclimb
438+
from freeclimb.api import default_api
439+
from freeclimb.model.completion_result import CompletionResult
440+
from freeclimb.model.completion_request import CompletionRequest
441+
from pprint import pprint
442+
# Defining the host is optional and defaults to https://www.freeclimb.com/apiserver
443+
# See configuration.py for a list of all supported configuration parameters.
444+
configuration = freeclimb.Configuration(
445+
host = "https://www.freeclimb.com/apiserver"
446+
)
447+
448+
# The client must configure the authentication and authorization parameters
449+
# in accordance with the API server security policy.
450+
# Examples for each auth method are provided below, use the example that
451+
# satisfies your auth use case.
452+
453+
# Configure HTTP basic authorization: fc
454+
configuration = freeclimb.Configuration(
455+
username = 'ACCOUNT_ID',
456+
password = 'API_KEY'
457+
)
458+
459+
# Enter a context with an instance of the API client
460+
with freeclimb.ApiClient(configuration) as api_client:
461+
# Create an instance of the API class
462+
api_instance = default_api.DefaultApi(api_client)
463+
account_id = "accountId_example" # str | ID of the account
464+
knowledge_base_id = "knowledgeBaseId_example" # str | A string that uniquely identifies the KnowledgeBase resource.
465+
completion_request = CompletionRequest(
466+
query="query_example",
467+
) # CompletionRequest | Completion request details (optional)
468+
469+
# example passing only required values which don't have defaults set
470+
try:
471+
# Query the knowledge base
472+
api_response = api_instance.create_knowledge_base_completion(knowledge_base_id)
473+
pprint(api_response)
474+
except freeclimb.ApiException as e:
475+
print("Exception when calling DefaultApi->create_knowledge_base_completion: %s\n" % e)
476+
477+
# example passing only required values which don't have defaults set
478+
# and optional values
479+
try:
480+
# Query the knowledge base
481+
api_response = api_instance.create_knowledge_base_completion(knowledge_base_id, completion_request=completion_request)
482+
pprint(api_response)
483+
except freeclimb.ApiException as e:
484+
print("Exception when calling DefaultApi->create_knowledge_base_completion: %s\n" % e)
485+
```
486+
487+
488+
### Parameters
489+
490+
Name | Type | Description | Notes
491+
------------- | ------------- | ------------- | -------------
492+
**knowledge_base_id** | **str**| A string that uniquely identifies the KnowledgeBase resource. |
493+
**completion_request** | [**CompletionRequest**](CompletionRequest.md)| Completion request details | [optional]
494+
495+
### Return type
496+
497+
[**CompletionResult**](CompletionResult.md)
498+
499+
### Authorization
500+
501+
[fc](../README.md#fc)
502+
503+
### HTTP request headers
504+
505+
- **Content-Type**: application/json
506+
- **Accept**: application/json
507+
508+
509+
### HTTP response details
510+
511+
| Status code | Description | Response headers |
512+
|-------------|-------------|------------------|
513+
**200** | KnowledgeaBase completion response | - |
514+
515+
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
516+
425517
# **delete_a_recording**
426518
> delete_a_recording(account_id, recording_id)
427519

freeclimb/__init__.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
"""
1212

1313

14-
__version__ = "4.7.0"
14+
__version__ = "4.8.0"
1515

1616
# import ApiClient
1717
from freeclimb.api_client import ApiClient
@@ -54,6 +54,8 @@
5454
from freeclimb.model.call_result_all_of import CallResultAllOf
5555
from freeclimb.model.call_status import CallStatus
5656
from freeclimb.model.capabilities import Capabilities
57+
from freeclimb.model.completion_request import CompletionRequest
58+
from freeclimb.model.completion_result import CompletionResult
5759
from freeclimb.model.conference_list import ConferenceList
5860
from freeclimb.model.conference_list_all_of import ConferenceListAllOf
5961
from freeclimb.model.conference_participant_list import ConferenceParticipantList

freeclimb/api/default_api.py

Lines changed: 153 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,8 @@
3232
from freeclimb.model.call_list import CallList
3333
from freeclimb.model.call_result import CallResult
3434
from freeclimb.model.call_status import CallStatus
35+
from freeclimb.model.completion_request import CompletionRequest
36+
from freeclimb.model.completion_result import CompletionResult
3537
from freeclimb.model.conference_list import ConferenceList
3638
from freeclimb.model.conference_participant_list import ConferenceParticipantList
3739
from freeclimb.model.conference_participant_result import ConferenceParticipantResult
@@ -311,6 +313,69 @@ def __init__(self, api_client=None, account_id=None):
311313
},
312314
api_client=api_client
313315
)
316+
self.create_knowledge_base_completion_endpoint = _Endpoint(
317+
settings={
318+
'response_type': (CompletionResult,),
319+
'auth': [
320+
'fc'
321+
],
322+
'endpoint_path': '/Accounts/{accountId}/KnowledgeBases/{knowledgeBaseId}/Completion',
323+
'operation_id': 'create_knowledge_base_completion',
324+
'http_method': 'POST',
325+
'servers': None,
326+
},
327+
params_map={
328+
'all': [
329+
'account_id',
330+
'knowledge_base_id',
331+
'completion_request',
332+
],
333+
'required': [
334+
'account_id',
335+
'knowledge_base_id',
336+
],
337+
'nullable': [
338+
],
339+
'enum': [
340+
],
341+
'validation': [
342+
]
343+
},
344+
root_map={
345+
'validations': {
346+
},
347+
'allowed_values': {
348+
},
349+
'openapi_types': {
350+
'account_id':
351+
(str,),
352+
'knowledge_base_id':
353+
(str,),
354+
'completion_request':
355+
(CompletionRequest,),
356+
},
357+
'attribute_map': {
358+
'account_id': 'accountId',
359+
'knowledge_base_id': 'knowledgeBaseId',
360+
},
361+
'location_map': {
362+
'account_id': 'path',
363+
'knowledge_base_id': 'path',
364+
'completion_request': 'body',
365+
},
366+
'collection_format_map': {
367+
}
368+
},
369+
headers_map={
370+
'accept': [
371+
'application/json'
372+
],
373+
'content_type': [
374+
'application/json'
375+
]
376+
},
377+
api_client=api_client
378+
)
314379
self.delete_a_recording_endpoint = _Endpoint(
315380
settings={
316381
'response_type': None,
@@ -3864,6 +3929,94 @@ def create_an_application(
38643929

38653930
return self.create_an_application_endpoint.call_with_http_info(**kwargs)
38663931

3932+
def create_knowledge_base_completion(
3933+
self,
3934+
knowledge_base_id,
3935+
**kwargs
3936+
):
3937+
"""Query the knowledge base # noqa: E501
3938+
3939+
This method makes a synchronous HTTP request by default. To make an
3940+
asynchronous HTTP request, please pass async_req=True
3941+
3942+
>>> thread = api.create_knowledge_base_completion(knowledge_base_id, async_req=True)
3943+
>>> result = thread.get()
3944+
3945+
3946+
Args:
3947+
3948+
3949+
knowledge_base_id (str): A string that uniquely identifies the KnowledgeBase resource.
3950+
3951+
3952+
3953+
3954+
Keyword Args:
3955+
completion_request (CompletionRequest): Completion request details. [optional]
3956+
_return_http_data_only (bool): response data without head status
3957+
code and headers. Default is True.
3958+
_preload_content (bool): if False, the urllib3.HTTPResponse object
3959+
will be returned without reading/decoding response data.
3960+
Default is True.
3961+
_request_timeout (int/float/tuple): timeout setting for this request. If
3962+
one number provided, it will be total request timeout. It can also
3963+
be a pair (tuple) of (connection, read) timeouts.
3964+
Default is None.
3965+
_check_input_type (bool): specifies if type checking
3966+
should be done one the data sent to the server.
3967+
Default is True.
3968+
_check_return_type (bool): specifies if type checking
3969+
should be done one the data received from the server.
3970+
Default is True.
3971+
_spec_property_naming (bool): True if the variable names in the input data
3972+
are serialized names, as specified in the OpenAPI document.
3973+
False if the variable names in the input data
3974+
are pythonic names, e.g. snake case (default)
3975+
_content_type (str/None): force body content-type.
3976+
Default is None and content-type will be predicted by allowed
3977+
content-types and body.
3978+
_host_index (int/None): specifies the index of the server
3979+
that we want to use.
3980+
Default is read from the configuration.
3981+
async_req (bool): execute request asynchronously
3982+
3983+
Returns:
3984+
CompletionResult
3985+
If the method is called asynchronously, returns the request
3986+
thread.
3987+
"""
3988+
kwargs['async_req'] = kwargs.get(
3989+
'async_req', False
3990+
)
3991+
kwargs['_return_http_data_only'] = kwargs.get(
3992+
'_return_http_data_only', True
3993+
)
3994+
kwargs['_preload_content'] = kwargs.get(
3995+
'_preload_content', True
3996+
)
3997+
kwargs['_request_timeout'] = kwargs.get(
3998+
'_request_timeout', None
3999+
)
4000+
kwargs['_check_input_type'] = kwargs.get(
4001+
'_check_input_type', True
4002+
)
4003+
kwargs['_check_return_type'] = kwargs.get(
4004+
'_check_return_type', True
4005+
)
4006+
kwargs['_spec_property_naming'] = kwargs.get(
4007+
'_spec_property_naming', False
4008+
)
4009+
kwargs['_content_type'] = kwargs.get(
4010+
'_content_type')
4011+
kwargs['_host_index'] = kwargs.get('_host_index')
4012+
kwargs['account_id'] = \
4013+
self.account_id
4014+
4015+
kwargs['knowledge_base_id'] = \
4016+
knowledge_base_id
4017+
4018+
return self.create_knowledge_base_completion_endpoint.call_with_http_info(**kwargs)
4019+
38674020
def delete_a_recording(
38684021
self,
38694022
recording_id,

freeclimb/api_client.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ def __init__(self, configuration=None, header_name=None, header_value=None,
7777
self.default_headers[header_name] = header_value
7878
self.cookie = cookie
7979
# Set default User-Agent.
80-
self.user_agent = 'OpenAPI-Generator/4.7.0/python'
80+
self.user_agent = 'OpenAPI-Generator/4.8.0/python'
8181

8282
def __enter__(self):
8383
return self

0 commit comments

Comments
 (0)