Skip to main content

AI-powered Hello World generator - A fun project that uses AI to output Hello World

Project description

vibe-helloworld

一个有趣的AI驱动的Hello World生成器项目
中文 | English

系统要求

  • Python 3.10+

安装

pip install vibe-helloworld

使用方法

from vibe_helloworld import VibeHelloWorld

# 设置环境变量
# export OPENAI_API_KEY="your_api_key_here"
# export OPENAI_BASE_URL="https://api.openai.com/v1/chat/completions"  # 可选,默认使用官方地址
# export OPENAI_MODEL="gpt-4o-mini"  # 可选,默认使用 gpt-4o-mini

# 结构化输出模式(默认)- 返回 "hello world"
result = VibeHelloWorld("This is my first AI project")
print(result)  # "hello world"

# 正常聊天对话模式 - 返回 AI 的正常回复
response = VibeHelloWorld("How are you today?", chat_with_nlp=False)
print(response)  # AI的正常聊天回复

# 更多示例
structured = VibeHelloWorld("测试消息", chat_with_nlp=True)
print(structured)  # "hello world"

chat = VibeHelloWorld("你好,请介绍一下自己", chat_with_nlp=False)
print(chat)  # AI的自我介绍

参数说明

  • message: str: 输入消息
  • chat_with_nlp: bool = True:
    • True: 使用结构化输出,强制返回 "hello world"
    • False: 正常聊天对话模式,返回 AI 的自然回复

环境变量

  • OPENAI_API_KEY: OpenAI API 密钥(必需)
  • OPENAI_BASE_URL: API 基础地址(可选,默认为官方地址)
  • OPENAI_MODEL: 使用的模型(可选,默认为 gpt-4o-mini

License

MIT

Project details


Download files

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

Source Distribution

vibe_helloworld-0.1.1.tar.gz (62.6 kB view details)

Uploaded Source

Built Distribution

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

vibe_helloworld-0.1.1-py3-none-any.whl (5.1 kB view details)

Uploaded Python 3

File details

Details for the file vibe_helloworld-0.1.1.tar.gz.

File metadata

  • Download URL: vibe_helloworld-0.1.1.tar.gz
  • Upload date:
  • Size: 62.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.8.11

File hashes

Hashes for vibe_helloworld-0.1.1.tar.gz
Algorithm Hash digest
SHA256 b29748971e8b834cccaf04d2d1ec4b7f011378b981ab4b93e8f6d2f64750a808
MD5 51259bfa87707f16d41c6b98ec5f4a0b
BLAKE2b-256 1ae8a30721857dc743d49860dad2da7684612573aebaf7d01a0973002586eff4

See more details on using hashes here.

File details

Details for the file vibe_helloworld-0.1.1-py3-none-any.whl.

File metadata

File hashes

Hashes for vibe_helloworld-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 ea7e32a31568033df92741ab6a730abe1a279519f237c524f43cc99acef6ff34
MD5 4f058453207adb7b6964aa7208bfa068
BLAKE2b-256 0025bca913596772df2141e4bbdf01a33e97cf595c099b143c60cf415be714f7

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