{"id":26873760,"url":"https://github.com/edenai/unity-plugin","last_synced_at":"2025-10-18T03:02:50.227Z","repository":{"id":234068271,"uuid":"674185389","full_name":"edenai/unity-plugin","owner":"edenai","description":"The Unity EdenAI Plugin simplifies integrating AI tasks like text-to-speech, chatbots and other generative AI into Unity applications using the EdenAI API.","archived":false,"fork":false,"pushed_at":"2024-01-15T14:10:49.000Z","size":183,"stargazers_count":25,"open_issues_count":0,"forks_count":4,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-03-31T09:20:03.141Z","etag":null,"topics":["ai","artificial-intelligence","edenai","gpt","openai","speech-synthesis","text-to-speech","unity","voice"],"latest_commit_sha":null,"homepage":"https://edenai.co","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/edenai.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2023-08-03T10:35:55.000Z","updated_at":"2025-03-17T18:42:15.000Z","dependencies_parsed_at":"2024-04-18T04:12:03.309Z","dependency_job_id":"dc176ace-791f-4427-943f-0c2c827cf6ee","html_url":"https://github.com/edenai/unity-plugin","commit_stats":null,"previous_names":["edenai/unity-plugin"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/edenai%2Funity-plugin","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/edenai%2Funity-plugin/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/edenai%2Funity-plugin/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/edenai%2Funity-plugin/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/edenai","download_url":"https://codeload.github.com/edenai/unity-plugin/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252863522,"owners_count":21816046,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ai","artificial-intelligence","edenai","gpt","openai","speech-synthesis","text-to-speech","unity","voice"],"created_at":"2025-03-31T09:20:08.625Z","updated_at":"2025-10-18T03:02:50.145Z","avatar_url":"https://github.com/edenai.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Unity Eden AI Plugin\n\nThe Unity Eden AI Plugin provides easy integration with the Eden AI API to perform various AI tasks such as text-to-speech conversion, chatbot interactions, and more within your Unity applications.\n\n**Table of Contents**\n\n- [Installation](#installation)\n- [Getting Started](#getting-started)\n- [Usage](#usage)\n  - [Initialize the EdenAI API](#initialize-the-edenai-api)\n  - [Chat](#chat)\n    - [SendChatRequest](#sendchatrequest)\n      - [Parameters](#parameters)\n      - [Return Value](#return-value)\n      - [Example Usage](#example-usage)\n  - [Text to Speech](#text-to-speech)\n    - [SendTextToSpeechRequest](#sendtexttospeechrequest)\n      - [Parameters](#parameters-1)\n      - [Return Value](#return-value-1)\n      - [Example Usage](#example-usage-1)\n  - [Ask your data](#ask-your-data)\n    - [SendYodaRequest](#sendyodarequest)\n      - [Parameters](#parameters-2)\n      - [Return Value](#return-value-2)\n      - [Example Usage](#example-usage-2)\n  - [Translation](#translation-coming-soon)\n  - [Image Generation](#image-generation-coming-soon)\n  - [Spell Check](#spell-check-coming-soon)\n  - [Sentiment Analysis](#sentiment-analysis-coming-soon)\n  - [Summarize](#summarize-coming-soon)\n  - [Speech Analysis](#speech-analysis-coming-soon)\n  - [OCR](#ocr-coming-soon)\n  - [Explicit Content Detection](#explicit-content-detection-coming-soon)\n  - [Image Generation](#image-generation-coming-soon)\n\n## Installation\nTo use the Unity Eden AI Plugin in your Unity project, follow these steps:\n1. Open your Unity Package Manager\n2. Add package from git url : [https://github.com/edenai/unity-plugin.git](https://github.com/edenai/unity-plugin.git)\n## Getting Started\nTo get started with the Unity EdenAI Plugin, you should:\n1. [Install the Plugin](#installation).\n2. [Obtain an Eden AI API Key](https://app.edenai.run/user/register?referral=github-unity) if you haven't already.\n3. You need to provide your EdenAI API Key to use this plugin. You can set it in your script or\nadd a file `auth.json` to your user folder (path: `~/.edenai` (Linux/Mac) or `%USERPROFILE%/.edenai/` (Windows))\nas follows:\n```json\n{\n  \"api_key\": \"YOUR_EDENAI_API_KEY\"\n}\n```\n4. Follow the [usage](#usage) instructions provided below.\n\n## Usage\n### Initialize the Eden AI API\nYou can create an instance of the `EdenAIApi` class by passing your API key as a parameter.\nIf the API key is not provided, it will attempt to read it from the auth.json file in your user folder.\n```csharp\nusing EdenAI;\n\nEdenAIApi edenAI = new EdenAIApi(\"YOUR_EDENAI_API_KEY\");\n```\n### Chat\nYou can use the plugin to chat with natural language processing models in your Unity project.\n#### SendChatRequest\nThis function is designed to send a request for chat and retrieve the generated text.\nIn case of errors, a `System.Exception` will be raised.\n#### Parameters\n* **provider** (string) : The data will be redirected to a single provider to obtain the processed results (ex : \"openai\").\nFor a list of available providers, please refer to our [documentation](https://docs.edenai.co/reference/text_chat_create).\n* **text** (string) : The input text for the chat conversation.\n* **chatBotGlobalAction** (string) _(optional)_: A system message that helps set the behavior of the assistant. For example, \"You are a helpful assistant\".\n* **previousHistory** (List\u003cChatMessage\u003e) _(optional)_: A list containing all the previous conversations between the user and the chatbot AI.\nEach item in the list should be a ChatMessage object, which contains **Role** (`user` or `assistant`) and **Message** (the text of the conversions from the respective role). For example : new List\u003cChatMessage\u003e(new ChatMessage() { Role = \"assistant\", Message = \"Hi, how can I help You ?\"}).\n* **model** (string) _(optional)_ : The specific model to use for the given provider (ex : \"gpt-3.5-turbo\").\n\n#### Return Value\nThis function returns a `ChatResponse` object, which contains :\n* **status** (string) : `fail` or `success`\n* **provider** (string) : The provider used to process the data.\n* **generated_text** (string) :  The generated text by the chatbot AI.\n* **message** (List\u003cChatMessage\u003e) : The messages between the `user` and the `assistant`.\n* **cost** (double) : The cost of the api call.\n\n#### Example Usage\n```csharp\nusing EdenAI;\nusing System;\nusing System.Threading.Tasks;\n\nclass Program\n{\n    static async Task Main(string[] args)\n    {\n        string provider = \"openai\";\n        string text = \"Hello I'm fine and you ?\";\n        ChatMessage chatMessage = new ChatMessage()\n        {\n            Role = \"assistant\",\n            Message = \"Hello how are you ?\"\n        };\n        List\u003cChatMessage\u003e previousHistory = new List\u003cChatMessage\u003e{ chatMessage };\n        EdenAIpi edenAI = new EdenAIApi();\n        ChatResponse response = await edenAI.SendChatRequest(provider, text, previousHistory: previousHistory);\n    }\n};\n```\n### Text to Speech\nYou can use the plugin to convert text to speech in your Unity project.\nIn case of errors, a `System.Exception` will be raised.\n#### SendTextToSpeechRequest\nThis function is designed to send a request for text-to-speech conversion and retrieve the generated audio output.\n\n\u003ca id=\"parameters-1\"\u003e\u003c/a\u003e\n#### Parameters\n* **provider** (string) : The data will be redirected to a single provider to obtain the processed results (ex : \"amazon\").\n  For a list of available providers, please refer to our [documentation](https://docs.edenai.co/reference/audio_text_to_speech_create).\n* **text** (string) : The text to analyze.\n* **audioFormat** (string) : The audio format in which the audio will be generated (ex : \"mp3\").\n* **option** (TextToSpeechOption) : Specifies the voice for the generated speech. You can choose from the following\noptions: `TextToSpeechOption.FEMALE` or `TextToSpeechOption.MALE` \n* **language** (string) : The language code (ex : \"en\").\nFor a list of available languages, please refer to our [documentation](https://docs.edenai.co/reference/audio_text_to_speech_create).\n* **rate** (int) _(optional)_ : Increase or decrease the speaking rate by expressing a positif or negatif number ranging\nbetween 100 and -100 (a relative value as percentage varying from -100% to 100%)\n* **pitch** (int) _(optional)_ : Increase or decrease the speaking pitch by expressing a positif or negatif number\nranging between 100 and -100 (a relative value as percentage varying from -100% to 100%)\n* **volume** (int) _(optional)_ : Increase or decrease the audio volume by expressing a positif or negatif number\nranging between 100 and -100 (a relative value as percentage varying from -100% to 100%)\n* **voiceModel** (string) _(optional)_ : The specific model to use for the given provider (ex : \"en-US_Justin_Standard\").\n\n\u003ca id=\"return-value-1\"\u003e\u003c/a\u003e\n#### Return Value\nThis function returns a `TextToSpeechResponse` object, which contains :\n* **status** (string) : `fail` or `success`\n* **provider** (string) : The provider used to process the data.\n* **cost** (double) : The cost of the api call.\n* **audio** (AudioClip) : The audio generated.\n* **audio_base64** (string) : The audio generated in base64.\n\n\u003ca id=\"example-usage-1\"\u003e\u003c/a\u003e\n#### Example Usage\n\n```csharp\nusing EdenAI;\nusing System;\nusing System.Threading.Tasks;\n\nclass Program\n{\n    static async Task Main(string[] args)\n    {\n        string provider = \"amazon\";\n        string text = \"Hello how are you ?\";\n        string audioFormat = \"mp3\";\n        TextToSpeechOption option = TextToSpeechOption.FEMALE;\n        string language = \"en\";\n        string voiceModel = \"en-US_Justin_Standard\";\n\n        EdenAIApi edenAI = new EdenAIApi();\n        TextToSpeechResponse response = await edenAI.SendTextToSpeechRequest(provider,\n            text, audioFormat, option, language, voiceModel: voiceModel);\n    }\n}\n```\n\n### Ask your data\nYou can use the plugin to interact with your data using [AskYoda](https://app.edenai.run/bricks/edenai-products/askyoda/default)\nin your Unity project.\n#### Create a AskYoda project\nVisit [Yoda on Eden AI](https://app.edenai.run/bricks/edenai-products/askyoda/default) and initiate your initial project.\n\n![Yoda](Image/Yoda.png)\n#### SendYodaRequest\nThis function is designed to send a request to interact with your data and retrieve the generated text.\nIn case of errors, a `System.Exception` will be raised.\n\n\u003ca id=\"parameters-2\"\u003e\u003c/a\u003e\n#### Parameters\n* **projectID** (string) : The ID your AskYoda project. \n* **query** (string) : The question or query about the data.\n* **history** (List\u003cDictionary\u003cstring, string\u003e\u003e) _(optional)_ :  A list containing all the previous conversations between the user and the chatbot AI.\nEach dictionary item in the list should contain alternating \"user\" and \"assistant\" messages, with their associated roles and text. For example : new List\u003cDictionary\u003cstring, string\u003e\u003e{new Dictionary\u003cstring, string\u003e { { \"user\", \"Hi!\" }, { \"assistant\", \"Hi, how can I help you?\" }}};.\n* **k** (int) _(optional)_ : The number of result chunk to return.\n* **llmModel** (string) _(optional)_ : The model to use for language processing.\n* **llmProvider** (string) _(optional)_ : The provider for the large language model (LLM) for processing.\nFor a list of available providers, please refer to our [documentation](\"https://docs.edenai.co/reference/aiproducts_askyoda_ask_llm_create\").\n\n\u003ca id=\"return-value-2\"\u003e\u003c/a\u003e\n#### Return Value\nThis function returns a `YodaResponse` object, which contains :\n* **result** (string) : The large language model (LLM) response.\n\n\u003ca id=\"example-usage-2\"\u003e\u003c/a\u003e\n#### Example Usage\n```csharp\nusing EdenAI;\nusing System;\nusing System.Threading.Tasks;\n\nclass Program\n{\n    static async Task Main(string[] args)\n    {\n        string projectID = \"YOUR_YODA_PROJECT_ID\";\n        string query = \"Which product is the most expensive?\";\n\n        EdenAIApi edenAI = new EdenAIApi();\n        YodaResponse response = await edenAI.SendYodaRequest(projectID, query);\n    }\n}\n```\n### Translation: COMING SOON\n### Image Generation: COMING SOON\n### Spell Check: COMING SOON\n### Sentiment Analysis: COMING SOON\n### Summarize: COMING SOON\n### Speech Analysis: COMING SOON\n### OCR: COMING SOON\n### Explicit Content Detection: COMING SOON\n### Image Generation: COMING SOON\n\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fedenai%2Funity-plugin","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fedenai%2Funity-plugin","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fedenai%2Funity-plugin/lists"}