Skip to content

Commit 2036c4f

Browse files
committed
rename Completion to ChatCompletion for correctness
1 parent 3f21683 commit 2036c4f

3 files changed

Lines changed: 11 additions & 11 deletions

File tree

README.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# LLM API for python
22

3-
This python library connects to (llm-api)[https://github.com/1b5d/llm-api] using python, it was build to mimic (OpenAI's python library)[https://github.com/openai/openai-python]
3+
This python library connects to [llm-api](https://github.com/1b5d/llm-api) using python, it was build to mimic [OpenAI's python library](https://github.com/openai/openai-python)
44

55
# Usage
66

@@ -10,31 +10,31 @@ You can install this library using pip
1010
pip install llm-api-python
1111
```
1212

13-
After running (llm-api)[https://github.com/1b5d/llm-api], simply configure your client as if it's OpenAI's python binding
13+
After running [llm-api](https://github.com/1b5d/llm-api), simply configure your client as if it's OpenAI's python binding
1414

1515
```python
1616
import llm_api
1717

1818
llm_api.api_key = "<your llm-api api key here>"
1919

20-
completion = llm_api.Completion.create(messages=[
20+
completion = llm_api.ChatCompletion.create(messages=[
2121
{
2222
"role": "system",
2323
"content": "You are a helpful assistant, please answer the users' questions with honesty and accuracy."
2424
}, {
2525
"role": "user", "content": "What is the capital of France?"
2626
}
27-
]) # returns a completion object
27+
]) # returns a chat completion object
2828

29-
completion = llm_api.Completion.create(messages=[
29+
completion = llm_api.ChatCompletion.create(messages=[
3030
...
3131
], stream=True) # returns a generator
3232

33-
completion = await llm_api.Completion.acreate(messages=[
33+
completion = await llm_api.ChatCompletion.acreate(messages=[
3434
...
35-
]) # returns a completion object
35+
]) # returns a chat completion object
3636

37-
completion = await llm_api.Completion.acreate(messages=[
37+
completion = await llm_api.ChatCompletion.acreate(messages=[
3838
...
3939
], stream=True) # returns a async generator
4040

llm_api/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,10 @@
66
import requests
77
from aiohttp import ClientSession
88

9-
from llm_api.completion import Completion
9+
from llm_api.completion import ChatCompletion
1010
from llm_api.error import APIError, InvalidRequestError, LlmApiError # noqa: F401
1111

12-
__all__ = ["Completion"]
12+
__all__ = ["ChatCompletion"]
1313

1414
api_key = os.environ.get("LLM_API_API_KEY")
1515
api_key_path: Optional[str] = os.environ.get("LLM_API_API_KEY_PATH")

llm_api/completion.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
DEFAULT_PROMPT = "You are a helpful assistant."
1212

1313

14-
class Completion(ApiObject):
14+
class ChatCompletion(ApiObject):
1515
"""A wrapper for LLM API client completion."""
1616

1717
@classmethod

0 commit comments

Comments
 (0)