chat
completion
audio
images
async
stream
with_raw_response
retry
error
pip install --upgrade greptimeai
首先,注册 GreptimeAI 以创建一个服务,并获取以下参数:
host
database
token
export GREPTIMEAI_HOST='xxx'
export GREPTIMEAI_DATABASE='xxx'
export GREPTIMEAI_TOKEN='xxx'
openai_patcher.setup(
host=os.environ.get("GREPTIMEAI_HOST"),
database=os.environ.get("GREPTIMEAI_DATABASE"),
token=os.environ.get("GREPTIMEAI_TOKEN"),
client=client,
)
from greptimeai import openai_patcher
from openai import OpenAI
client = OpenAI()
openai_patcher.setup(client=client)
completion = client.chat.completions.create(
messages=[
{
"role": "user",
"content": "How do I output all files in a directory using Python?",
}
],
model="gpt-4",
user="<user_id_from_your_application>",
stream=True,
)

(The demonstration of GreptimeAI)

(The details of trace)
Greptime 格睿科技于 2022 年创立,目前正在完善和打造时序数据库 GreptimeDB,格睿云 GreptimeCloud 和可观测工具 GreptimeAI 这三款产品。
GreptimeDB 是一款用 Rust 语言编写的时序数据库,具有分布式、开源、云原生、兼容性强等特点,帮助企业实时读写、处理和分析时序数据的同时,降低长期存储的成本。
GreptimeCloud 基于开源的 GreptimeDB,为用户提供全托管的 DBaaS,能够与可观测性、物联网等领域结合的应用产品结合。利用云提供软件和服务,可以达到快速的自助开通和交付,标准化的运维支持,和更好的资源弹性。
GreptimeAI 是为 LLM 应用量身定制的可观测性解决方案,开发者可以通过该方案全面、深入地了解应用的成本、性能、流量和安全情况,在保证低成本和高性能的同时提供高效可靠的分析能力,同时保留了时序数据库的灵活性。
GreptimeCloud 已正式公测,欢迎关注公众号或官网了解最新动态!
官网:https://greptime.cn/
GitHub: https://github.com/GreptimeTeam/greptimedb
文档:https://docs.greptime.cn/
Twitter: https://twitter.com/Greptime
Slack: https://greptime.com/slack
LinkedIn: https://www.linkedin.com/company/greptime/
往期精彩文章:


GreptimeDB 提供 Enterprise 企业版服务,如有需要请联系 info@greptime.com 或添加小助手微信(微信号:greptime).
👇 点击下方阅读原文,立即体验 GreptimeAI!





