Welcome to Portkey Forum

Home
Members
Harold Senzei
H
Harold Senzei
Offline, last seen 3 days ago
Joined November 21, 2024
are the analytics apis open for all orgs? If not can you please enable it for our org
4 comments
S
H
How do I enable json mode on togetherai's models? They have some models that support it but portkey's prompt ui does not allow adding json mode.
3 comments
S
H
On the play ground, it would be good to have ability to add auth token for vertex ai models. Right now we are not able to test them at all on the playground.
10 comments
H
V
W
is there a way to enable structured responses on vertex ai models? the UI on prompt library doesn't show an option like it shows for openai models
7 comments
H
s
R
V
I am only to set the max tokens to 4k from the ui on prompt library for vertex ai gemini-flash-2 . The maximum allowed for flash-2 is 8192. is this a bug?
2 comments
R
V
doesn't portkey change from max_tokens to max_completion_tokens at gateway level for o3-mini? I am using the portkey library integrated with langchain. When I change the model to o3-mini on the prompts page, all calls are falling with 400 due to the args issue.


ref for implementation: https://discord.com/channels/1143393887742861333/1321096743336808479/1322092663591272531
11 comments
s
H
V
Hey is there a way to get logs to have the prompt id in the export? I am working on some pricing questions and want to check which prompts can be replaced with smaller models and how the pricing is being affected.
8 comments
a
V
W
H
A waterfall view for latency for a trace would be pretty neat, to identify the bottle necks.
4 comments
s
H
V
Hey would there be a delay in changing parameters on the prompt page and it reflecting for api calls? I have tried changing the model that a prompt uses but when I do a prompt/completion call it is using a different model
14 comments
H
V
Been using it for a while now would love to try
2 comments
V
H
Another feature that would be nice to have would be to see the request timing for the entire trace on traces page, rather than having to calculate it from each individual request
5 comments
r
V
H
Hey how do we add labels to partials?
4 comments
V
It would be great to have breadcrumb navigation for folders on prompt library, right now when changing multiple prompts in a folder one has to go back to main page of prompt library, select folder and then select the prompt. A better way would be to go back to the folder from the prompt page itself.
1 comment
V
is there a way to specify prompt partial like variables are specified?

Example:
I have two prompts

You an {{>partital}}

Partial 1
Expert Summary Generator

Partial 2
Expert Web Developer

is there there a way to pass a variable to pick between the two partials without passing the entire partial text?
7 comments
V
H
Hey when using prompt render with response_mode json set in the template. I have a new parameter in response body
Plain Text
  "response_format": {
      "type": "json_object"
    },
but when using the python sdk the PromptRenderData object does not have that field is it expected?
Plain Text
class PromptRenderData(BaseModel):
    messages: Optional[List[ChatCompletionMessage]] = None
    prompt: Optional[str] = None
    model: Optional[str] = None
    suffix: Optional[str] = None
    max_tokens: Optional[int] = None
    temperature: Optional[float] = None
    top_k: Optional[int] = None
    top_p: Optional[float] = None
    n: Optional[int] = None
    stop_sequences: Optional[List[str]] = None
    timeout: Union[float, None] = None
    functions: Optional[List[Function]] = None
    function_call: Optional[Union[None, str, Function]] = None
    logprobs: Optional[bool] = None
    top_logprobs: Optional[int] = None
    echo: Optional[bool] = None
    stop: Optional[Union[str, List[str]]] = None
    presence_penalty: Optional[int] = None
    frequency_penalty: Optional[int] = None
    best_of: Optional[int] = None
    logit_bias: Optional[Dict[str, int]] = None
    user: Optional[str] = None
    organization: Optional[str] = None
    tool_choice: Optional[Union[None, str]] = None
    tools: Optional[List[Tool]] = None

how do I access it?
11 comments
H
V
C
When I am using json mode for prompt library and I have an empty variable, the render endpoint returns 502

example :

create a prompt template with this,

Plain Text
[{
  "content": [
    {
      "type": "text",
      "text": "You are an helpful AI assistant. My name is {{name}}"
    }
  ],
  "role": "system"
},{{history_messages}},{
  "content": [
    {
      "type": "text",
      "text": "{{input}}"
    }
  ],
  "role": "user"
}]


If you call the render endpoint with
Plain Text
variables= {"name" : "portkey"}

you get 500 error


If you call with
Plain Text
variables= {"name" : "portkey", "history_messages" : []}

you get 502 error.

So in this how do I call with an empty history_messages?
7 comments
W
H
b
is there any example on using prompt library with tools and forced tool use with openai?
2 comments
s
H
Hey, I cannot seem to get portkey to work with langchain for google's models.
This is a sample of what I am using
Plain Text
from langchain_openai import ChatOpenAI
from portkey_ai import createHeaders, PORTKEY_GATEWAY_URL

PORTKEY_API_KEY = "..."
VIRUTAL_KEY = "..." # Virtual Key I created

portkey_headers = createHeaders(api_key=PORTKEY_API_KEY,virtual_key= VIRUTAL_KEY)

llm = ChatOpenAI(api_key="x", base_url=PORTKEY_GATEWAY_URL, default_headers=portkey_headers, model="gemini-1.5-pro")

llm.invoke("What is the meaning of life, universe and everything?")


I have attached the trace back.
I am on the latest version of all the packages as I ran pip install -U langchain-core portkey_ai langchain-openai before starting
2 comments
s
H