Giter Site home page Giter Site logo

stephanfward / openai-server-client-chat Goto Github PK

View Code? Open in Web Editor NEW
0.0 2.0 1.0 9 KB

Simplified example demonstrating how to use gRPC in Python to create a client-server application where a Python script interacts with the GPT-4 language model hosted on a server

License: Apache License 2.0

Python 100.00%
chatgpt chatgpt-api gprc python

openai-server-client-chat's Introduction

openAI-server-client-chat

Simplified example demonstrating how to use gRPC in Python to create a client-server application where a Python script interacts with the GPT-4 language model hosted on a server

This example demonstrates a basic client-server interaction using gRPC in Python, where the server uses the GPT-4 language model to generate responses to input text received from the client. You can extend it further by handling multiple concurrent requests, implementing error handling, and integrating with real-world applications.

Clone the repository: git clone https://github.com/your-username/openAI-server-client-chat.git

Install the necessary dependencies: pip install -r requirements.txt

Set up your OpenAI API key: Sign up for an account on the OpenAI platform and obtain an API key. Set your API key as an environment variable: '''export OPENAI_API_KEY="your-api-key'''

Start the server by running: python server.py.

In another terminal window, run: python client.py.

You should see the client sending input text to the server, and the server responding with text generated by the GPT-4 model.

openai-server-client-chat's People

Contributors

stephanfward avatar

Watchers

 avatar  avatar

Forkers

ian75013

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.