more debug

This commit is contained in:
Nicholas Albion
2023-10-04 15:47:47 +11:00
parent 11da00605a
commit 366e88dc4d
2 changed files with 4 additions and 0 deletions

View File

@@ -163,6 +163,7 @@ class TestDeveloper:
response = requests.Response()
response.status_code = 200
response.iter_lines = lambda: [line]
print(f'##### mock response: {response}')
return response
mock_requests_post.side_effect = generate_response

View File

@@ -266,6 +266,7 @@ def stream_gpt_completion(data, req_type, project):
logger.info(f'> Request model: {model} ({data["model"]}) messages: {data["messages"]}')
logger.info(f'##### build endpoint...')
if endpoint == 'AZURE':
# If yes, get the AZURE_ENDPOINT from .ENV file
@@ -291,6 +292,8 @@ def stream_gpt_completion(data, req_type, project):
'Authorization': 'Bearer ' + os.getenv('OPENAI_API_KEY')
}
logger.info(f'##### 0.1, endpoint: {endpoint}, headers: {headers}')
response = requests.post(
endpoint_url,
headers=headers,