
How to Use ODEI with Any AI Framework
ODEI Works with Any AI Framework The ODEI API is framework-agnostic. Here is how to use it with any setup. The Universal Pattern Three steps, any framework: import requests ODEI = " https://api.odei.ai/api/v2 " TOKEN = " your-token " # From api.odei.ai/integrate/ def check ( action : str ) -> bool : r = requests . post ( f " { ODEI } /guardrail/check " , headers = { " Authorization " : f " Bearer { TOKEN } " }, json = { " action " : action }). json () return r [ " verdict " ] == " APPROVED " def memory ( term : str ) -> dict : return requests . post ( f " { ODEI } /world-model/query " , headers = { " Authorization " : f " Bearer { TOKEN } " }, json = { " queryType " : " search " , " searchTerm " : term }). json () Framework Examples LangChain: from langchain.tools import tool @tool def odei_check ( action : str ) -> str : return str ( check ( action )) CrewAI: from crewai.tools import BaseTool class GuardrailTool ( BaseTool ): name = " guardrail " description = " Validate action before
Continue reading on Dev.to Tutorial
Opens in a new tab


