🕒 feat: Add 5-second timeout for Fetching Model Lists (#4423)

* refactor: add 5 second timeout for fetching AI provider model lists

* ci: fix test due to recent changes
This commit is contained in:
Danny Avila 2024-10-15 19:37:41 -04:00 committed by GitHub
parent ef118009f6
commit c54a57019e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 16 additions and 9 deletions

View file

@ -291,7 +291,9 @@ describe('fetchModels with Ollama specific logic', () => {
});
expect(models).toEqual(['Ollama-Base', 'Ollama-Advanced']);
expect(axios.get).toHaveBeenCalledWith('https://api.ollama.test.com/api/tags'); // Adjusted to expect only one argument if no options are passed
expect(axios.get).toHaveBeenCalledWith('https://api.ollama.test.com/api/tags', {
timeout: 5000,
});
});
it('should handle errors gracefully when fetching Ollama models fails', async () => {