Skip to main content

LLM plugin for answering questions about Twitter profiles

Project description

llm-twitter

PyPI Changelog License

LLM plugin for answering questions about Twitter profiles

Installation

Install this plugin in the same environment as LLM:

llm install llm-twitter

Configuration

Set your Twitter API bearer token as an environment variable:

export TWITTER_BEARER_TOKEN="your_twitter_bearer_token_here"

You can obtain a bearer token by applying for a Twitter Developer account and creating an application at https://developer.twitter.com/

Usage

To use the llm-twitter plugin, run the following command:

llm twitter "Your question about the Twitter profile" --account @username

Options:

  • --account or -a: Twitter account (username or @username) - required
  • --no-stream: Do not stream output
  • --force-refresh or -f: Force refresh of the cached profile
  • --model or -m: Specify a different LLM model to use for the response

Examples:

llm twitter "What is the user's follower count?" --account @openai
llm twitter "Summarize the user's bio" --account @elonmusk --no-stream
llm twitter "What are the main topics this user tweets about?" --account @ylecun --force-refresh
llm twitter "Analyze the user's Twitter presence" --account @google --model gpt-4

Development

To set up this plugin locally, first checkout the code. Then create a new virtual environment:

cd llm-twitter
python -m venv venv
source venv/bin/activate

Now install the dependencies and test dependencies:

pip install -e '.[test]'

To run the tests:

pytest

Contributing

Contributions to llm-twitter are welcome! Please refer to the GitHub repository for more information on how to contribute.

License

This project is licensed under the Apache License 2.0. See the LICENSE file for details.

Project details


Release history Release notifications | RSS feed

This version

0.1

Download files

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

Source Distribution

llm_twitter-0.1.tar.gz (3.5 kB view details)

Uploaded Source

Built Distribution

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

llm_twitter-0.1-py3-none-any.whl (3.9 kB view details)

Uploaded Python 3

File details

Details for the file llm_twitter-0.1.tar.gz.

File metadata

  • Download URL: llm_twitter-0.1.tar.gz
  • Upload date:
  • Size: 3.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.1

File hashes

Hashes for llm_twitter-0.1.tar.gz
Algorithm Hash digest
SHA256 1c058853cb2c83a8470dff997788d99ad0854575be7fe3fbb8367e7580809a81
MD5 6a31d7e8ebe3f5d99ef1c92b470e4711
BLAKE2b-256 046a92593d6bfea14129d3661044eacb10fe87f04ba8d5823c2971dc416b1ced

See more details on using hashes here.

File details

Details for the file llm_twitter-0.1-py3-none-any.whl.

File metadata

  • Download URL: llm_twitter-0.1-py3-none-any.whl
  • Upload date:
  • Size: 3.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.1

File hashes

Hashes for llm_twitter-0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 121c8eedaa7d48d5f573baacfc4e6129adf8c70b61e6b56aa1f48556f97930fb
MD5 cdb8e85b648427038dc61455a5dedfb3
BLAKE2b-256 772ae346bbf9965e221e55aa4d3f73065fbc46889510132ac1017d9534e07d42

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