forked from Qewertyy/LexicaAPI
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
better approach for LLMs, minor changes, new models and fixes
- Loading branch information
Showing
14 changed files
with
79 additions
and
147 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,11 @@ | ||
import asyncio | ||
from lexica import AsyncClient | ||
from lexica.constants import languageModels | ||
|
||
async def main(prompt: str) -> dict: | ||
async def async_main(prompt: str) -> dict: | ||
client = AsyncClient() | ||
response = await client.bard(prompt) | ||
response = await client.ChatCompletion(prompt,languageModels.bard) | ||
return response | ||
|
||
if __name__ == "__main__": | ||
print(asyncio.run(main("hello, who are you?"))) | ||
print(asyncio.run(async_main("hello, who are you?"))) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,11 @@ | ||
import asyncio | ||
from lexica import AsyncClient | ||
from lexica.constants import languageModels | ||
|
||
async def main(prompt: str) -> dict: | ||
async def async_main(prompt: str) -> dict: | ||
client = AsyncClient() | ||
response = await client.gpt(prompt) | ||
response = await client.ChatCompletion(prompt,languageModels.gpt) | ||
return response | ||
|
||
if __name__ == "__main__": | ||
print(asyncio.run(main("hello, who are you?"))) | ||
print(asyncio.run(async_main("hello, who are you?"))) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import asyncio | ||
from lexica import AsyncClient | ||
from lexica.constants import languageModels | ||
|
||
async def async_main(prompt: str) -> dict: | ||
client = AsyncClient() | ||
response = await client.ChatCompletion(prompt,languageModels.llama) | ||
return response | ||
|
||
if __name__ == "__main__": | ||
print(asyncio.run(async_main("hello, who are you?"))) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import asyncio | ||
from lexica import AsyncClient | ||
from lexica.constants import languageModels | ||
|
||
async def async_main(prompt: str) -> dict: | ||
client = AsyncClient() | ||
response = await client.ChatCompletion(prompt,languageModels.mistral) | ||
return response | ||
|
||
if __name__ == "__main__": | ||
print(asyncio.run(async_main("hello, who are you?"))) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,12 @@ | ||
from lexica import AsyncClient | ||
import asyncio | ||
from lexica.constants import languageModels | ||
|
||
async def async_main(prompt: str) -> dict: | ||
client = AsyncClient() | ||
response = await client.palm(prompt) | ||
response = await client.ChatCompletion(prompt,languageModels.palm) | ||
await client.close() | ||
return response | ||
|
||
if __name__ == "__main__": | ||
print(asyncio.run(async_main("hello world"))) | ||
print(asyncio.run(async_main("hello, who are you?"))) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
from lexica import Client | ||
from lexica.constants import languageModels | ||
|
||
def main(prompt: str) -> dict: | ||
client = Client() | ||
response = client.ChatCompletion(prompt,languageModels.llama) | ||
return response | ||
|
||
if __name__ == "__main__": | ||
print(main("hello, who are you?")) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
from lexica import Client | ||
from lexica.constants import languageModels | ||
|
||
def main(prompt: str) -> dict: | ||
client = Client() | ||
response = client.ChatCompletion(prompt,languageModels.mistral) | ||
return response | ||
|
||
if __name__ == "__main__": | ||
print(main("hello, who are you?")) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,7 +8,7 @@ def get_long_description(): | |
|
||
setup( | ||
name="lexica-api", | ||
version="1.4.0", | ||
version="1.4.3", | ||
author="Qewertyy", | ||
author_email="[email protected]", | ||
description="The python package for api.qewertyy.me", | ||
|