From 69e9d0da79812b6a0d44a882f89c8ab26ae4ba9b Mon Sep 17 00:00:00 2001 From: Pavan Kumar Date: Wed, 21 Aug 2024 14:57:32 +0530 Subject: [PATCH] exclude citation from openai request --- ResearchAssistant/App/app.py | 2 +- ResearchAssistant/Deployment/bicep/main.bicep | 2 +- ResearchAssistant/Deployment/bicep/main.json | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/ResearchAssistant/App/app.py b/ResearchAssistant/App/app.py index 5b060a2e..2118caa3 100644 --- a/ResearchAssistant/App/app.py +++ b/ResearchAssistant/App/app.py @@ -152,7 +152,7 @@ def prepare_body_headers_with_data(request): messages = [{"role": "system", "content": AZURE_OPENAI_SYSTEM_MESSAGE}] for message in request_messages: - if message: + if message and message.get("role") != "tool": messages.append({"role": message["role"], "content": message["content"]}) body = { diff --git a/ResearchAssistant/Deployment/bicep/main.bicep b/ResearchAssistant/Deployment/bicep/main.bicep index f9d39faf..4969dc4d 100644 --- a/ResearchAssistant/Deployment/bicep/main.bicep +++ b/ResearchAssistant/Deployment/bicep/main.bicep @@ -170,7 +170,7 @@ module appserviceModule 'deploy_app_service.bicep' = { AzureOpenAIModelName:'gpt-4o' AzureOpenAITemperature:'0' AzureOpenAITopP:'1' - AzureOpenAIMaxTokens:'1000' + AzureOpenAIMaxTokens:'800' AzureOpenAIStopSequence:'' AzureOpenAISystemMessage:'''You are a research grant writer assistant chatbot whose primary goal is to help users find information from research articles or grants in a given search index. Provide concise replies that are polite and professional. Answer questions truthfully based on available information. Do not answer questions that are not related to Research Articles or Grants and respond with "I am sorry, I don’t have this information in the knowledge repository. Please ask another question.". Do not answer questions about what information you have available. diff --git a/ResearchAssistant/Deployment/bicep/main.json b/ResearchAssistant/Deployment/bicep/main.json index 70daca6a..7a5d9739 100644 --- a/ResearchAssistant/Deployment/bicep/main.json +++ b/ResearchAssistant/Deployment/bicep/main.json @@ -1444,7 +1444,7 @@ "value": "1" }, "AzureOpenAIMaxTokens": { - "value": "1000" + "value": "800" }, "AzureOpenAIStopSequence": { "value": ""