gpt-batch 0.1.5__tar.gz → 0.1.6__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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: gpt_batch
3
- Version: 0.1.5
3
+ Version: 0.1.6
4
4
  Summary: A package for batch processing with OpenAI API.
5
5
  Home-page: https://github.com/fengsxy/gpt_batch
6
6
  Author: Ted Yu
@@ -42,16 +42,20 @@ class GPTBatcher:
42
42
 
43
43
  def get_attitude(self, ask_text):
44
44
  index, ask_text = ask_text
45
-
46
- completion = self.client.chat.completions.create(
47
- model=self.model_name,
48
- messages=[
49
- {"role": "system", "content": self.system_prompt},
50
- {"role": "user", "content": ask_text}
51
- ],
52
- temperature=self.temperature,
53
- )
54
- return (index, completion.choices[0].message.content)
45
+ try:
46
+ completion = self.client.chat.completions.create(
47
+ model=self.model_name,
48
+ messages=[
49
+ {"role": "system", "content": self.system_prompt},
50
+ {"role": "user", "content": ask_text}
51
+ ],
52
+ temperature=self.temperature,
53
+ )
54
+ return (index, completion.choices[0].message.content)
55
+ except Exception as e:
56
+ print(f"Error occurred: {e}")
57
+ self.miss_index.append(index)
58
+ return (index, None)
55
59
 
56
60
  def process_attitude(self, message_list):
57
61
  new_list = []
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: gpt-batch
3
- Version: 0.1.5
3
+ Version: 0.1.6
4
4
  Summary: A package for batch processing with OpenAI API.
5
5
  Home-page: https://github.com/fengsxy/gpt_batch
6
6
  Author: Ted Yu
@@ -2,7 +2,7 @@ from setuptools import setup, find_packages
2
2
 
3
3
  setup(
4
4
  name='gpt_batch',
5
- version='0.1.5',
5
+ version='0.1.6',
6
6
  packages=find_packages(),
7
7
  install_requires=[
8
8
  'openai', 'tqdm'
File without changes
File without changes
File without changes