Welcome to Portkey Forum

Home
Members
Snape | Portkey
S
Snape | Portkey
Offline, last seen yesterday
Joined November 4, 2024
27 comments
S
d
V
@elentaure. @bgeneto You can restrict models using the config by mentioning it in the override params, but this would be limited to one per object, you can have multiple objects in the config
Plain Text
portkey = Portkey(
    api_key="...",
    config={
        "override_params": {
            "model": "gpt-4o"
        },
        "virtual_key": "openai-cxy-362aeb"
    }
)
27 comments
S
e
m
b
Hey @bluehorshoe452_15_07606 Just moving your question about perplexity prompt fine tuning to this channel instead of #portkey-bugs because looks like you want to talk about prompt finetuning strategies

Hello I am using the perplexity API. I have an open question query - i.e users are allowed to ask any question in an open search. I have the following system prompt: Your task is to respond to the question by analyzing the most recent content from the internet. Please put your response in a paragraph format and do not exceed more than 200 words. When answering do not cut off your sentences.. The responses get cut off - meaning the last sentence is usually incomplete and doesn't finish the thought. In the user prompt I simply have "{{question}}" . Any ideas on how to not let Perplexity provide sentences at the end that are cut off? Do I need to add more context in the User prompt in Portkey?
Also curious if anyone has figured out how to get the sources from Perplexity API to show up in the responses as it does it in web interface
6 comments
V
b
S
I've verified that tool_config in gemini works as intended @artyabra ,
If you require gemini to always use a tool, you can pass "tool_choice": "required" in the SDK or the API as per OpenAI format
Plain Text
{
    "model": "gemini-1.5-pro",
    "max_tokens": 200,
    "stream": false,
    "messages": [
        {
            "role": "system",
            "content": "Say Hi"
        },
        {
            "role": "user",
            "content": "Hey, what is the temperature in San Francisco in Celsius? Also tell me the current time"
        }
    ],
    "tool_choice": "required",
    "tools": [
      ....    
    ]
}
17 comments
a
S
V