oneliai 0.1.0__tar.gz → 0.2.0__tar.gz

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.

Potentially problematic release.


This version of oneliai might be problematic. Click here for more details.

@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: oneliai
3
- Version: 0.1.0
3
+ Version: 0.2.0
4
4
  Summary: SDK for ONELI.AI Customer API
5
5
  Author: oneli.ai
6
6
  Requires-Python: >=3.6
@@ -1,7 +1,7 @@
1
1
  import requests
2
2
 
3
- # URL="https://apis.oneli.chat"
4
- URL="http://localhost:8085"
3
+ URL="https://apis.oneli.chat"
4
+ # URL="http://localhost:8085"
5
5
  class AIClient:
6
6
  def __init__(self, client_id, client_secret, base_url=f'{URL}/v1/strategy'):
7
7
  self.client_id = client_id
@@ -23,10 +23,11 @@ class AIClient:
23
23
  else:
24
24
  raise Exception('Failed to get access token')
25
25
 
26
- def generate_response(self, template_id, variables):
26
+ def generate_response(self, question,template_id, variables):
27
27
  response = requests.post(
28
28
  f'{self.base_url}/dynamic-response',
29
29
  json={
30
+ 'question':question,
30
31
  'template_id': template_id,
31
32
  'variables': variables
32
33
  },
@@ -66,6 +67,7 @@ class AIClient:
66
67
  if response.status_code == 200:
67
68
  return response.json()
68
69
  else:
70
+
69
71
  raise Exception('Failed to start intention query')
70
72
 
71
73
  def voc(self,productname,text):
@@ -95,7 +97,8 @@ class AIClient:
95
97
  if response.status_code == 200:
96
98
  return response.json()
97
99
  else:
98
- raise Exception('Failed to start voc ')
100
+ res=response.json()
101
+ raise Exception(f'Failed to start voc,reason:{res["error"]}')
99
102
 
100
103
  # def registEndpoint(self, name,endpointpath):
101
104
  # response = requests.post(
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: oneliai
3
- Version: 0.1.0
3
+ Version: 0.2.0
4
4
  Summary: SDK for ONELI.AI Customer API
5
5
  Author: oneli.ai
6
6
  Requires-Python: >=3.6
@@ -19,7 +19,7 @@ from setuptools import setup, find_packages
19
19
 
20
20
  setup(
21
21
  name='oneliai',
22
- version="0.1.0",
22
+ version="0.2.0",
23
23
  author="oneli.ai",
24
24
  description='SDK for ONELI.AI Customer API',
25
25
  # long_description=open("README.md").read(),
File without changes
File without changes