Giter Club home page Giter Club logo

tg-api's Introduction

TG-API Telegram Badge

Few APIs for @pyguru telegram channel.

API Endpoints

Base Endpoint : https://tgapi-7d0b0583d985.herokuapp.com
Documentation : https://tgapi-7d0b0583d985.herokuapp.com/docs

Basic Example

Here's a simple python requests based example of our /gpt endpoint

import requests

url = "https://tgapi-7d0b0583d985.herokuapp.com/api/v1/llmodels/gpt"
payload = {
	"prompt": "hello. How are you ?"
}
response = requests.post(url, json=payload)
print(response.json())

Contributions are welcome

Create a new issue about what you want to implement. The API is written in FastAPI and python so a basic knowledge of both is expected. Also we directly integrate this api with our telegram bot, so make sure your feature should be compatible with our bot. Contact admins for the same.

How to setup the project

  • Create a fork and a new branch
  • Clone the repository
  • Create virtual environment python -m venv venv
  • install requirements.txt file pip install -r requirements.txt
  • Run main.py python main.py
  • Open the localhost port 8000 in browser http://localhost:8000/docs

Heroku Deployment

  • Procfile -> web: uvicorn app.api:app --host=0.0.0.0 --port=$PORT
  • heroku-cli -> heroku ps:scale web=1 --app tgapi

How to contribute

  • Once your issue gets a thumbsup 👍, setup the project
  • Now go to app folder & create a new folder as per your issue
  • Write python code for your issue in main.py in your newly created folder
  • Create a router with endpoints in router.py, refer to other folder codes for help
  • If your api endpoint is expecting a body, write the base model for it in model.py
  • Finally include your newly created router in api.py
  • Test your code on localhost for all possible cases, do add exception handling
  • Push the code and create a PR.

Show some ❤️ by starring this repository!


This Repository is Participating in Hacktoberfest 2023



To participate and contribute checkout our issues section. You can also discuss new ideas in our telegram group here @pyguru

Our other repositiores partcipating in Hacktoberfest 2023

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.