You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Good afternoon everyone. I'm currently working on a project where I need to generate images using dall-e-3. I'm doing this using the DallEAPIWrapper class, so far so good.
The problem is when I try to generate images using the same class but using PortKey endpoints. Currently, it only lets me put the baseURL in the class, but it doesn't let me send the headers.
An example of how to do this is with the ChatOpenAI class, which has a configuration parameter that lets me send the portkey configuration through that class. I'd like to be able to do the same thing, but with the CustomDallEAPIWrapper class.
import{DallEAPIWrapper}from'@langchain/openai';import{createHeaders,PORTKEY_GATEWAY_URL}from"portkey-ai"createImagePortKeyConnection(modelName: string,style: "natural"|"vivid",quality: "standard"|"hd",size: "1024x1024"|"1024x1792"): void{constportkeyConf={baseURL: PORTKEY_GATEWAY_URL,headers: createHeaders({apiKey: envs.portkey_api_key,virtualKey: envs.portkey_open_ai_virtual_key,})};this.llmImageOpenAI=newDallEAPIWrapper({apiKey: envs.openai_api_key,
modelName,
style,
quality,
size,baseUrl: portkeyConf.baseURL,// only exist this paramether to config});}
In my case, it's not enough to point to the portkey baseURL, as I need to send the corresponding headers to view the consumption graphs for that model and the request costs. It would be great if the configuration parameter existed within the DallEAPIWrapper class as well as the ChatOpenAI class.
I would appreciate it if any of you could help me.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Good afternoon everyone. I'm currently working on a project where I need to generate images using dall-e-3. I'm doing this using the DallEAPIWrapper class, so far so good.
The problem is when I try to generate images using the same class but using PortKey endpoints. Currently, it only lets me put the baseURL in the class, but it doesn't let me send the headers.
An example of how to do this is with the ChatOpenAI class, which has a configuration parameter that lets me send the portkey configuration through that class. I'd like to be able to do the same thing, but with the CustomDallEAPIWrapper class.
Below is a code example.
integration via portkey using ChatOpenAI class:
Integration via portkey using ChatOpenAI class:
In my case, it's not enough to point to the portkey baseURL, as I need to send the corresponding headers to view the consumption graphs for that model and the request costs. It would be great if the configuration parameter existed within the DallEAPIWrapper class as well as the ChatOpenAI class.
I would appreciate it if any of you could help me.
Beta Was this translation helpful? Give feedback.
All reactions