vossr / Chat-With-RTX-python-api

Chat With RTX Python API
56 stars 10 forks source link

Feature request: OpenAI-compatible api #2

Open whisper-bye opened 6 months ago

whisper-bye commented 6 months ago

Can chat with rtx be made into an OpenAI-compatible api service?

plop-dev commented 5 months ago

chat with rtx is local so I don't see how it would work as an API compatible with openai

whisper-bye commented 5 months ago

https://ollama.com/blog/openai-compatibility

JoeM71 commented 4 months ago

Could you add italian language? Italian language is fundamental for literature and history!

Bilalline commented 5 days ago

Could you add italian language? Italian language is fundamental for literature and history!

I was able to add Russian language support for the 4th version of chatrtx.

from http.client import HTTPConnection

def send_message(message):
    connection = HTTPConnection('192.168.1.57', 18137)
    headers = {'Content-type': 'text/plain; charset=utf-8'}
    # Кодируем сообщение в UTF-8
    encoded_message = message.encode('utf-8')
    connection.request('POST', '/', encoded_message, headers)
    response = connection.getresponse()

    if response.status == 200:
        return response.read().decode('utf-8')
    else:
        raise Exception("Error: Server responded with status {}".format(response.status))

although it’s better to look at my entire project, since I’m still new to programming.