Angel Mayr
Angel Mayr5mo ago

Issues with the responses received from Azure OpenAI using my own data.

Hello everyone! I have a flow that makes a request to the Azure OpenAI API, and I am using fetch for this request. However, it doesn't always return the responses I expect. For example, there are certain questions that it only responds to in the Azure OpenAI portal, but not in the request from Buildship. On other occasions, it responds in English despite setting in the system prompt that its responses should be in Spanish. I'm using cURL with parameters such as "data_source" and their nested objects. { "data_sources": [ { "type": "azure_search", "parameters": { "endpoint": "search_endpoint", "index_name": "search_index", "semantic_configuration": "index-semantic-configuration", "query_type": "vectorSemanticHybrid", "in_scope": true, "role_information": "You are a helpful assistant", "filter": null, "strictness": 3, "top_n_documents": 6, "authentication": { "type": "api_key", "key": "search_key" }, "embedding_dependency": { "type": "deployment_name", "deployment_name": "text-embedding-3-small" } } } ], "messages": [ { "role": "system", "content": "You are a helpful assistant" }, { "role": "user", "content": "prompt" } ], "deployment": "model", "temperature": 0, "top_p": 1, "max_tokens": 800, "stop": null //stream: true, -> I disabled this option because I can't receive information in real-time; however, I don't think that it affects the issue. } Has anyone had this problem and managed to solve it? I appreciate your responses.
1 Reply
AI Support
AI Support5mo ago
Your issue seems to be related to the inconsistency in responses from the Azure OpenAI API when using it within BuildShip. This could be due to several factors, including how the request is formatted, the settings used, or even the environment in which the request is made. Here are a few suggestions to troubleshoot and potentially resolve the issue: 1. Ensure Correct API Endpoint and Parameters: Double-check that all the parameters and endpoints are correctly set in your request. Ensure that the data_sources and messages objects are correctly formatted. 2. Consistent Language Setting: Make sure that the language setting is consistently applied. In your system message, you can specify the language explicitly:
{
"role": "system",
"content": "You are a helpful assistant. Please respond in Spanish."
}

{
"role": "system",
"content": "You are a helpful assistant. Please respond in Spanish."
}

3. Check API Key and Authentication: Verify that the API key and authentication details are correct and have the necessary permissions. 4. Debugging Responses: Add logging to capture the full response from the API to understand what is being returned and why it might not match your expectations. 5. Test in Isolation: Test the same request using a tool like Postman or cURL directly from your terminal to ensure that the issue is not specific to the BuildShip environment. 6. Adjusting Parameters: Experiment with different parameters, such as temperature, top_p, and max_tokens, to see if they affect the consistency of the responses. 7. Handle Streaming: Even though you disabled streaming, ensure that other related settings are correctly configured. If you continue to face issues, it might be beneficial to contact BuildShip support via in-app support for more specific troubleshooting related to the BuildShip environment. For more detailed documentation on using variables and making API requests in BuildShip, you can refer to: https://docs.buildship.com/basics/variables
Using Variables – BuildShip
Learn how to use variables, contexts, and output values in your workflow logic.