Skip to content

EVI flutter example - Config ID Not Considered When Connecting to EVI #138

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
andreasnaoum opened this issue Jan 18, 2025 · 3 comments
Closed

Comments

@andreasnaoum
Copy link

Description:

While setting up the configuration in the EVI Flutter example, I noticed that the example defaults to connecting with EVI 1. After reviewing the code, I found that the API does not consider the config_id when attempting to connect to EVI.

Current Implementation (Issue):

In main.dart, the code only appends the api_key when no access_token is provided. However, there is no consideration for the config_id, which is essential for connecting to a specific configuration.

Current Code:

var uri = 'wss://api.hume.ai/v0/evi/chat';
if (ConfigManager.instance.humeAccessToken.isNotEmpty) {
  uri += '?access_token=${ConfigManager.instance.humeAccessToken}';
} else if (ConfigManager.instance.humeApiKey.isNotEmpty) {
  uri += '?api_key=${ConfigManager.instance.humeApiKey}';
} else {
  throw Exception('Please set your Hume API credentials in main.dart');
}

Proposed Fix:

To ensure the config_id is included when available, I suggest modifying the code as follows:

var uri = 'wss://api.hume.ai/v0/evi/chat';
if (ConfigManager.instance.humeAccessToken.isNotEmpty) {
  uri += '?access_token=${ConfigManager.instance.humeAccessToken}';
} else if (ConfigManager.instance.humeApiKey.isNotEmpty && ConfigManager.instance.humeConfigId.isNotEmpty) {
  uri += '?config_id=${ConfigManager.instance.humeConfigId}';
  uri += '&api_key=${ConfigManager.instance.humeApiKey}';
} else if (ConfigManager.instance.humeApiKey.isNotEmpty) {
  uri += '?api_key=${ConfigManager.instance.humeApiKey}';
} else {
  throw Exception('Please set your Hume API credentials in main.dart');
}

Let me know if you need further clarification or if you would like me to create a pull request for this fix.

Copy link

linear bot commented Jan 18, 2025

@SeanningTatum
Copy link
Contributor

Created a PR for this #133

@twitchard
Copy link
Contributor

(Fixed in #133)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants