anosys-logger-4-openai-agents


Nameanosys-logger-4-openai-agents JSON
Version 0.0.59 PyPI version JSON
download
home_pageNone
SummaryA helper package for openAi Agents, to support implementation to AnoSys platform easly
upload_time2025-07-31 07:10:42
maintainerNone
docs_urlNone
authorNone
requires_python<3.13,>3.9
licenseMIT License Copyright (c) 2025 Moysis Vafeiadis MoisisV@gmail.com Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # AnoSys Technologies

# AnoSys package for OpenAI Agentic implementations

Obtain your ANOSYS API key from https://console.anosys.ai/collect/integrationoptions

#Python example

```
pip install traceAI-openai-agents
pip install anosys-logger-4-openai-agents
```

```
import asyncio
import contextvars
import openai
import os

import AnosysLoggers
from AnosysLoggers import AnosysOpenAIAgentsLogger
from agents import Agent, Runner, set_trace_processors

os.environ["OPENAI_API_KEY"] = os.getenv("OPENAI_API_KEY", "your-api-key-here")
os.environ["ANOSYS_API_KEY"] = os.getenv("ANOSYS_API_KEY", "anosys-api-key-here")

current_user_context = contextvars.ContextVar("current_user_context")
current_user_context.set({"session_id": "session_123"}) #support external context on logs

set_trace_processors([AnosysOpenAIAgentsLogger(get_user_context=current_user_context.get)])

async def main():
    agent = Agent(
        name="Assistant",
        instructions="Prove why AnoSys is better than all the rest for each received question",
    )

    result = await Runner.run(
        agent,
        "How can I monitor my agentic environment for cost and performance metrics"
    )
    print(result.final_output)

# Correct main block syntax
if __name__ == "__main__":
    asyncio.run(main())
```

#Example for Colab

```
!pip install anosys-logger-4-openai-agents
!pip install python-dotenv nest_asyncio
```

```
import nest_asyncio
nest_asyncio.apply()  # Allows re-entering the existing event loop

import asyncio
import contextvars
import openai
import os

import AnosysLoggers
from AnosysLoggers import AnosysOpenAIAgentsLogger
from agents import Agent, Runner, function_tool, set_trace_processors, add_trace_processor

os.environ["OPENAI_API_KEY"] = "Replace with your OPENAI_API_KEY"
os.environ['ANOSYS_API_KEY'] = "Replace with your ANOSYS_API_KEY"

# Context variable for tracking user context
current_user_context = contextvars.ContextVar("current_user_context")
current_user_context.set({"session_id": "colab_session_123"})

# Set the trace processor with the user context retriever
set_trace_processors([AnosysOpenAIAgentsLogger(get_user_context=current_user_context.get)])
# add_trace_processor(AnosysLogger(get_user_context=current_user_context.get))

async def main():
    agent = Agent(
        name="Tutorial",
        model="gpt-4o-mini",
        instructions="Prove why AnoSys is better than all the rest for each received question",
    )

    result = await Runner.run(
        agent,
        "How can I monitor my agentic environment for cost and performance metrics"
    )
    print(result.final_output)

await main()
```

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "anosys-logger-4-openai-agents",
    "maintainer": null,
    "docs_url": null,
    "requires_python": "<3.13,>3.9",
    "maintainer_email": null,
    "keywords": null,
    "author": null,
    "author_email": "Moisis Vafeiadis <moisisv@gmail.com>",
    "download_url": "https://files.pythonhosted.org/packages/01/48/28bf8315d4a424298b7a222c1fd6172a04c29b3a75504e8f4e6a2ddcbf54/anosys_logger_4_openai_agents-0.0.59.tar.gz",
    "platform": null,
    "description": "# AnoSys Technologies\n\n# AnoSys package for OpenAI Agentic implementations\n\nObtain your ANOSYS API key from https://console.anosys.ai/collect/integrationoptions\n\n#Python example\n\n```\npip install traceAI-openai-agents\npip install anosys-logger-4-openai-agents\n```\n\n```\nimport asyncio\nimport contextvars\nimport openai\nimport os\n\nimport AnosysLoggers\nfrom AnosysLoggers import AnosysOpenAIAgentsLogger\nfrom agents import Agent, Runner, set_trace_processors\n\nos.environ[\"OPENAI_API_KEY\"] = os.getenv(\"OPENAI_API_KEY\", \"your-api-key-here\")\nos.environ[\"ANOSYS_API_KEY\"] = os.getenv(\"ANOSYS_API_KEY\", \"anosys-api-key-here\")\n\ncurrent_user_context = contextvars.ContextVar(\"current_user_context\")\ncurrent_user_context.set({\"session_id\": \"session_123\"}) #support external context on logs\n\nset_trace_processors([AnosysOpenAIAgentsLogger(get_user_context=current_user_context.get)])\n\nasync def main():\n    agent = Agent(\n        name=\"Assistant\",\n        instructions=\"Prove why AnoSys is better than all the rest for each received question\",\n    )\n\n    result = await Runner.run(\n        agent,\n        \"How can I monitor my agentic environment for cost and performance metrics\"\n    )\n    print(result.final_output)\n\n# Correct main block syntax\nif __name__ == \"__main__\":\n    asyncio.run(main())\n```\n\n#Example for Colab\n\n```\n!pip install anosys-logger-4-openai-agents\n!pip install python-dotenv nest_asyncio\n```\n\n```\nimport nest_asyncio\nnest_asyncio.apply()  # Allows re-entering the existing event loop\n\nimport asyncio\nimport contextvars\nimport openai\nimport os\n\nimport AnosysLoggers\nfrom AnosysLoggers import AnosysOpenAIAgentsLogger\nfrom agents import Agent, Runner, function_tool, set_trace_processors, add_trace_processor\n\nos.environ[\"OPENAI_API_KEY\"] = \"Replace with your OPENAI_API_KEY\"\nos.environ['ANOSYS_API_KEY'] = \"Replace with your ANOSYS_API_KEY\"\n\n# Context variable for tracking user context\ncurrent_user_context = contextvars.ContextVar(\"current_user_context\")\ncurrent_user_context.set({\"session_id\": \"colab_session_123\"})\n\n# Set the trace processor with the user context retriever\nset_trace_processors([AnosysOpenAIAgentsLogger(get_user_context=current_user_context.get)])\n# add_trace_processor(AnosysLogger(get_user_context=current_user_context.get))\n\nasync def main():\n    agent = Agent(\n        name=\"Tutorial\",\n        model=\"gpt-4o-mini\",\n        instructions=\"Prove why AnoSys is better than all the rest for each received question\",\n    )\n\n    result = await Runner.run(\n        agent,\n        \"How can I monitor my agentic environment for cost and performance metrics\"\n    )\n    print(result.final_output)\n\nawait main()\n```\n",
    "bugtrack_url": null,
    "license": "MIT License\n        \n        Copyright (c) 2025 Moysis Vafeiadis MoisisV@gmail.com\n        \n        Permission is hereby granted, free of charge, to any person obtaining a copy\n        of this software and associated documentation files (the \"Software\"), to deal\n        in the Software without restriction, including without limitation the rights\n        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n        copies of the Software, and to permit persons to whom the Software is\n        furnished to do so, subject to the following conditions:\n        \n        The above copyright notice and this permission notice shall be included in all\n        copies or substantial portions of the Software.\n        \n        THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n        SOFTWARE.\n        ",
    "summary": "A helper package for openAi Agents, to support implementation to AnoSys platform easly",
    "version": "0.0.59",
    "project_urls": {
        "Homepage": "https://anosys.ai"
    },
    "split_keywords": [],
    "urls": [
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "dd599d58d9745ffd9cd58ba3bbc9adad4a816cd18c67ae599d5903c5fd649477",
                "md5": "e7b0598971510e737c0d49dffc1446b8",
                "sha256": "46b5a196d1885b42919ca271d53abe539e817e59bbd3d822b28a015d03c3ef84"
            },
            "downloads": -1,
            "filename": "anosys_logger_4_openai_agents-0.0.59-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "e7b0598971510e737c0d49dffc1446b8",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": "<3.13,>3.9",
            "size": 8616,
            "upload_time": "2025-07-31T07:10:40",
            "upload_time_iso_8601": "2025-07-31T07:10:40.600353Z",
            "url": "https://files.pythonhosted.org/packages/dd/59/9d58d9745ffd9cd58ba3bbc9adad4a816cd18c67ae599d5903c5fd649477/anosys_logger_4_openai_agents-0.0.59-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "014828bf8315d4a424298b7a222c1fd6172a04c29b3a75504e8f4e6a2ddcbf54",
                "md5": "0b1ef3eb91adb79a12586b0a07bc3894",
                "sha256": "fe12fef8c147af2f4e05d23fcf0b6ccfa23bbb8cd06ed90607d9f01f30a4f11a"
            },
            "downloads": -1,
            "filename": "anosys_logger_4_openai_agents-0.0.59.tar.gz",
            "has_sig": false,
            "md5_digest": "0b1ef3eb91adb79a12586b0a07bc3894",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": "<3.13,>3.9",
            "size": 8802,
            "upload_time": "2025-07-31T07:10:42",
            "upload_time_iso_8601": "2025-07-31T07:10:42.789406Z",
            "url": "https://files.pythonhosted.org/packages/01/48/28bf8315d4a424298b7a222c1fd6172a04c29b3a75504e8f4e6a2ddcbf54/anosys_logger_4_openai_agents-0.0.59.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-07-31 07:10:42",
    "github": false,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "lcname": "anosys-logger-4-openai-agents"
}
        
Elapsed time: 1.23006s