Skip to content

Commit

Permalink
v1.0.6
Browse files Browse the repository at this point in the history
  • Loading branch information
davila7 committed Jan 28, 2024
1 parent 551ec37 commit 1bcec6f
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 39 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

# Judini Python Package 0.1.5
# Judini Python Package 0.1.6
The Judini Python library provides convenient access to CodeGPT's Judini REST API from any Python 3.7+ application. The library includes type definitions for all request parameters and response fields, and offers synchronous and asynchronous clients.

## Documentation
Expand Down
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[metadata]
name = judini
version = 0.1.5
version = 0.1.6
author = Daniel Avila
author_email = daniel@judini.ai
description = CodeGPT python package
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

setuptools.setup(
name="judini",
version="0.1.5",
version="0.1.6",
author="Judini Inc.",
author_email="daniel@judini.ai",
description="CodeGPT python package",
Expand Down
37 changes: 1 addition & 36 deletions src/judini/codegpt/chat.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import http
import json

base_url = "https://api-beta.codegpt.co/api/v1"
Expand All @@ -7,7 +6,6 @@ class Completion:
def __init__(self, api_key):
self.api_key = api_key


def create(self, agent_id, messages, stream=False):
headers = {
"Content-Type": "application/json",
Expand All @@ -18,37 +16,4 @@ def create(self, agent_id, messages, stream=False):
payload = json.dumps({
"agentId": agent_id,
"messages": messages
})

# conn = http.client.HTTPSConnection("api-beta.codegpt.co")
# url = "/api/v1/chat/completions"

# conn.request("POST", url, body=payload, headers=headers)
# res = conn.getresponse()
# try:
# data = res.read()
# except Exception as e:
# print(f"An error occurred: {e.__class__.__name__}")
# print(f"Error details: {str(e)}")

# content_data = ""
# if stream is False:
# data.decode("utf-8").replace('\n','').split('data: ')[1:]
# for jd_str in data:
# if jd_str:
# try:
# # data: {}
# json_data = json.loads(jd_str)
# for item in json_data['choices']:
# content_data += item['delta']['content']
# except:
# # data: [DONE]
# pass

# return content_data
# else:
# try:
# return data.decode("utf-8").replace('\n','').split('data: ')[1:]
# except Exception as e:
# print(f"An error occurred: {e.__class__.__name__}")
# print(f"Error details: {str(e)}")
})

0 comments on commit 1bcec6f

Please sign in to comment.