Skip to content

Commit

Permalink
Bump version to 0.4.0: Merge pull request #9 from atomiechen/dev
Browse files Browse the repository at this point in the history
Bump version to 0.4.0
  • Loading branch information
atomiechen authored Jul 29, 2023
2 parents eb90c29 + 624c0a1 commit 63d7630
Show file tree
Hide file tree
Showing 5 changed files with 287 additions and 114 deletions.
10 changes: 9 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ Example scripts are placed in [tests](./tests) folder.

## OpenAI API Request

### Logs
### Logger

You can pass custom `logger` and `log_marks` (a string or a collection of strings) to `chat`/`completions` to get input and output logging.

Expand Down Expand Up @@ -111,6 +111,14 @@ for text in OpenAIAPI.stream_chat(response):

Please refer to [OpenAI official API reference](https://platform.openai.com/docs/api-reference) for details.

### Azure

**Azure OpenAI APIs are supported!**

Refer to [test_azure.py](./tests/test_azure.py) for example usage.

Refer to [Azure OpenAI Service Documentation](https://learn.microsoft.com/en-us/azure/ai-services/openai/).



## Prompt
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"

[project]
name = "HandyLLM"
version = "0.3.1"
version = "0.4.0"
authors = [
{ name="Atomie CHEN", email="atomic_cwh@163.com" },
]
Expand Down
6 changes: 3 additions & 3 deletions src/handyllm/endpoint_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ def set_organizations(self, organizations):

def get_base_url(self):
if len(self._base_urls) == 0:
return OpenAIAPI.base_url
return OpenAIAPI.get_api_base()
else:
base_url = self._base_urls[self._last_idx_url]
if self._last_idx_url == len(self._base_urls) - 1:
Expand All @@ -49,7 +49,7 @@ def get_base_url(self):

def get_key(self):
if len(self._keys) == 0:
return OpenAIAPI.api_key
return OpenAIAPI.get_api_key()
else:
key = self._keys[self._last_idx_key]
if self._last_idx_key == len(self._keys) - 1:
Expand All @@ -60,7 +60,7 @@ def get_key(self):

def get_organization(self):
if len(self._organizations) == 0:
return OpenAIAPI.organization
return OpenAIAPI.get_organization()
else:
organization = self._organizations[self._last_idx_organization]
if self._last_idx_organization == len(self._keys) - 1:
Expand Down
Loading

0 comments on commit 63d7630

Please sign in to comment.