Skip to main content

A demonstration of the Poe protocol using FastAPI

Project description

fastapi_poe

An implementation of the Poe protocol using FastAPI.

To run it:

  • Create a virtual environment (Python 3.7 or higher)
  • pip install .
  • python -m fastapi_poe
  • In a different terminal, run ngrok to make it publicly accessible

Write your own bot

This package can also be used as a base to write your own bot. You can inherit from fastapi_poe.PoeHandler to make a bot:

from fastapi_poe import PoeHandler, run

class EchoHandler(PoeHandler):
    async def get_response(self, query):
        last_message = query.query[-1].content
        yield self.text_event(last_message)

if __name__ == "__main__":
    run(EchoHandler())

For a more advanced example that exercises more of the Poe protocol, see Catbot.

Project details


Release history Release notifications | RSS feed

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

fastapi_poe-0.0.3.tar.gz (4.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

fastapi_poe-0.0.3-py3-none-any.whl (6.3 kB view details)

Uploaded Python 3

File details

Details for the file fastapi_poe-0.0.3.tar.gz.

File metadata

  • Download URL: fastapi_poe-0.0.3.tar.gz
  • Upload date:
  • Size: 4.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.1

File hashes

Hashes for fastapi_poe-0.0.3.tar.gz
Algorithm Hash digest
SHA256 94a524f80d7f6b830431d30024a286654918ed41ad73f38c98f862e67d22f4b4
MD5 8db94e19981c0c5c9aff5a6f0083416e
BLAKE2b-256 2729272f6fb854194d1b0a387d938f2e3c298bdd6b7377494588372bde76565f

See more details on using hashes here.

File details

Details for the file fastapi_poe-0.0.3-py3-none-any.whl.

File metadata

  • Download URL: fastapi_poe-0.0.3-py3-none-any.whl
  • Upload date:
  • Size: 6.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.1

File hashes

Hashes for fastapi_poe-0.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 6fca6cf4bc3fa92087e9fb856825b119db4ed0a0871e2755d10304bb6b481d05
MD5 df16a1830246d1278132cd171cc2be61
BLAKE2b-256 5aa1544c70df93ddf923dc8af40f3f5b2fd42078a5ef268f165e1c9170b2d57e

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page