pezzolabs / pezzo

🕹️ Open-source, developer-first LLMOps platform designed to streamline prompt design, version management, instant delivery, collaboration, troubleshooting, observability and more.
https://pezzo.ai
Apache License 2.0
2.55k stars 211 forks source link

Add a simple shell/python in `How to Consume` tab #176

Closed sunny0826 closed 1 year ago

sunny0826 commented 1 year ago

Proposal

The current client only supports typescript. I hope to provide clients in more languages so that users can start using pezzo.ai faster, especially shell and Python.

Use-Case

just like

# Fetch the prompt from Pezzo
prompt=$(curl "https://api.pezzo.ai/api/prompts/v2/deployment?name=<prompt_name>&environmentName=<env>&projectId=<project_id>" -H "Content-Type: application/json" -H "x-pezzo-api-key: <api_key>" | jq .content.prompt)

# Processing data
new_content=${prompt/{sentence}/hey}
json_data='{"model":"gpt-3.5-turbo","messages":[{"role":"user","content":""}],"temperature":1,"max_tokens":2560,"top_p":1,"frequency_penalty":0,"presence_penalty":0}'
data=$(echo "${json_data}" | jq --arg new_content "${new_content}" '.messages[0].content = $new_content')

# Use the OpenAI API as you normally would
curl https://api.openai.com/v1/chat/completions \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer $OPENAI_API_KEY" \
  -d "${data}"

Is this a feature you are interested in implementing yourself?

Maybe

arielweinberger commented 1 year ago

Hi @sunny0826 thanks for the feature request! Python client makes total sense, and we're working on it - hoping to release it in the next couple of days.

About the shell client - do you have a concrete use case for this? I'm trying to understand how people see themselves interacting with Pezzo via shell.

sunny0826 commented 1 year ago

Ops, my description may have been a bit confusing. I just want to add the shell example in the How to Consume tab, the shell is the fastest way to start the first step of pezzo, like this 👇🏻 @arielweinberger You know that 80% of starts die in the first attempt.

image

I've changed the title of this Issue to avoid further confusion. BTW, I'd actually prefer to have a Go client.

arielweinberger commented 1 year ago

Good idea! Will add to our roadmap. We plan to release a Python client in the upcoming few days, and we'll make sure to update here, as well as in our docs.