https://promptfoo.dev/ logo
Dear Team,Request for Assistance with Promptfoo Cu...
# ❓|questions
r
Dear Team, I hope this message finds you well. I'm reaching out to discuss an important matter regarding our integration of the OpenAI service across our various repositories. Objective: Our primary goal is to ensure seamless integration of the OpenAI service across our repositories while maintaining customizations. Challenge: Currently, we face an issue where our customizations to the azureopenai.ts file get overridden during the pipeline installation process using "npm install @azure/openai". Proposed Solution: To address this challenge, we are considering the implementation of a custom provider. We've explored resources such as GitHub Example(https://github.com/promptfoo/promptfoo/tree/main/examples/custom-provider) and Promptfoo Documentation(https://www.promptfoo.dev/docs/providers/custom-api/). However, we encountered difficulties, particularly with the token authentication process (IAP error). Request for Assistance: We kindly seek your expertise in helping us navigate the creation and integration of the custom provider. Any guidance or support in resolving the authentication issue would be immensely appreciated. Cross-Repository Implementation: Additionally, we aim to implement this custom provider logic across different repositories, each utilizing diverse technologies (e.g., Backend: Java, Python; Frontend: JavaScript, TypeScript; Mobile CC: @ian @Ian
i
Hey @rajeshch_75247, happy to help troubleshoot. Information about the specific error and what you've tried so far would be useful
r
Hi team Hope all doing well I was created custom provider of azure openai for over riding the node modules provider but I am facing invalid Iap credentials could you please tell me how to overcome this issue CC: @User
i
Can you share the relevant parts of your config or implementation?
r
I am trying to over ride the node modules provider with my custom provider @ian
In promptfoo config file I placed providers: [./asureopenai] my custom provider @User
i
Have you set the client credentials like so?
Copy code
yaml
providers:
  - id: azureopenai:chat:deploymentNameHere
    config:
      apiHost: 'xxxxxxxx.openai.azure.com'
      azureClientId: 'your-azure-client-id'
      azureClientSecret: 'your-azure-client-secret'
      azureTenantId: 'your-azure-tenant-id'
      azureAuthorityHost: 'https://login.microsoftonline.com' # Optional
      azureTokenScope: 'https://cognitiveservices.azure.com/.default' # Optional
r
No
r
Please suggest @ian what is the best way to implement this.
r
@ian please provide any sample code of custom provider for azureopenai
i
You'll have to edit your promptfooconfig to match the above example with the necessary credentials
2 Views