aipotheosis-labs / aipotheosis-labs/aci

AI returns empty response when multiple GMAIL functions are selected

Open
#337 0 comments 0 reactions 1 assignee Claimed by @jiwei-aipolabs View on GitHub
Dominant language
Python
Stars
4.9k
Forks
484
PR merge metrics
No merged PRs in 30d

Description

### Required Pre-requisites

- [x] I have read the [Documentation](https://www.aci.dev/docs)
- [x] I have searched the [Issue Tracker](https://github.com/aipotheosis-labs/aci/issues) and [Discussions](https://github.com/aipotheosis-labs/aci/discussions) that this hasn't been reported yet.
- [x] Consider asking in [Discussions](https://github.com/aipotheosis-labs/aci/discussions) first

### Description

### **Description:**

When accessing the `/playground` endpoint and selecting **GMAIL** as the app while enabling all functions, the AI response encounters an exception. The backend throws an `openai.APIError` indicating a potential issue with the OpenAI API request. The error traceback points to the `openai_chat_stream` function in `aci/server/agent/prompt.py`.

Error log excerpt:

```
openai.APIError: There was an issue with your request. Please check your inputs and try again
```

---

### **Expected behavior:**

* Upon selecting **GMAIL** and all associated functions in the `/playground` endpoint, the API should successfully handle the GPT request and return the generated response data without any errors.

---

### **Actual behavior:**

* The API returns a 500 Internal Server Error with the following traceback:

```
server-1 | File "/workdir/.venv/lib/python3.12/site-packages/openai/_streaming.py", line 46, in __iter__
server-1 | for item in self._iterator:
server-1 | ^^^^^^^^^^^^^^
server-1 | File "/workdir/.venv/lib/python3.12/site-packages/openai/_streaming.py", line 91, in __stream__
server-1 | raise APIError(
server-1 | openai.APIError: There was an issue with your request. Please check your inputs and try again
```

---

### **Steps to reproduce:**

1. Navigate to `/playground`.
2. Select **GMAIL** as the app.
3. Enable **all available functions**.
4. Submit the request.
5. Observe the backend console for the error traceback.

---

![Image](https://github.com/user-attachments/assets/a3f28a0d-e0cb-49d7-8ca6-4c18927ecd52)

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.