Skip to main content
Glama
config.cpython-312.pyc5.15 kB
� ���g� ��X�dZddlmZddlZddlZddlZeGd�d��Ze�Zy)z� Configuration settings for the Unity MCP Server with Ollama integration. This file contains all configurable parameters for the server. �)� dataclassNc���eZdZUdZdZeed<dZeed<dZ eed<dZ e ed <d Z eed <d Z eed <dZeed<dZeed<dZe ed<dZeed<dZeed<dZeed<dZe ed<dZe ed<dZeed<d�Zd �Zd!�Zy")#� ServerConfigz,Main configuration class for the MCP server.� localhost� unity_hosti� unity_portid�mcp_portg.@�connection_timeouti�� buffer_size�INFO� log_levelz4%(asctime)s - %(name)s - %(levelname)s - %(message)s� log_format�� max_retriesg�?� retry_delay� ollama_hosti�,� ollama_port�llama3� ollama_modelg^@�ollama_timeoutgffffff�?�ollama_temperatureaVYou are a Unity development assistant that helps control the Unity Editor via commands. When asked to perform an action in Unity, you should call the appropriate function. Always respond with valid function calls when the user requests to modify the Unity scene. Use the most appropriate functions from the available tools. When working in Unity, follow these guidelines: 1. Check if objects exist before modifying them using find_objects_by_name() 2. Use descriptive names for any objects you create 3. Set appropriate transforms (position, rotation, scale) for new objects 4. Use proper colors for materials (RGB values between 0-1) 5. Save the scene after making significant changes 6. Use proper component names when adding components Remember that your function calls will be parsed and executed directly in Unity, so ensure they are correct.�ollama_system_promptc�$�|j�y)z@Initialize configuration and load from config file if available.N)�_load_from_file)�selfs ��C:\1_Sagyo\VRchat\Project\IshouJidouChouseiToul\Library\PackageCache\com.zundamonnovrchat.unity-mcp-ollama@994ecdcda9\Python\config.py�__init__zServerConfig.__init__6s�� ����c �<�tjjtjjt�d�}tjj |�rv t |d�5}tj|�}ddd�j�D]\}}t||�s�t|||��!tjd|���yy#1swY�UxYw#t$r.}tjd|�dt!|����Yd}~yd}~wwxYw)z9Load configuration from a local config file if available.�local_config.json�rNzLoaded configuration from zFailed to load config from �: )�os�path�join�dirname�__file__�exists�open�json�load�items�hasattr�setattr�logging�info� Exception�warning�str)r� config_file�f� config_data�key�value�es rrzServerConfig._load_from_file:s����g�g�l�l�2�7�7�?�?�8�#<�>Q�R� � �7�7�>�>�+� &� W��+�s�+�q�"&�)�)�A�,�K�,�#.�"3�"3�"5�J�C���t�S�)���c�5�1�#6�� � �9�+��G�H� '�+�+��� W����"=�k�]�"�S�QR�V�H� U�V�V�� W�s6�" C$�.C�*C$�/'C$�C!�C$�$ D�-$D�Dc ���tjjtjjt�d�} |j D�cic]}|t ||���}}t|d�5}tj||d��ddd�tjd|���ycc}w#1swY�'xYw#t$r.}tjd|�d t|����Yd}~y d}~wwxYw) z6Save the current configuration to a local config file.r �w�)�indentNzSaved configuration to TzFailed to save config to r"F)r#r$r%r&r'�__annotations__�getattrr)r*�dumpr/r0r1�errorr3)rr4r7� config_dictr5r9s r� save_to_filezServerConfig.save_to_fileKs����g�g�l�l�2�7�7�?�?�8�#<�>Q�R� � �>B�>R�>R�S�>R�s�3���c� 2�2�>R�K�S��k�3�'�1�� � �+�q��3�(� �L�L�2�;�-�@� A��� T�'�'�� � � �M�M�5�k�]�"�S��V�H�M� N��� �sB�B>�B-�%B>�3B2� B>�-B>�2B;�7B>�> C5�$C0�0C5N)�__name__� __module__� __qualname__�__doc__rr3r>r�intr r �floatr r rrrrrrrrrrrrC�rrrr s���6�"�J��!��J����H�c��!%���$��K����I�s��L�J��L��K����K���#�K��"��K��� �L�#� �!�N�E�!� #���#�!p��#�p� �W�"rr)rG� dataclassesrr#r*r/r�configrJrr�<module>rMs<��� "� � �� �M�M� �M�` ��r

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/ZundamonnoVRChatkaisetu/unity-mcp-ollama'

If you have feedback or need assistance with the MCP directory API, please join our Discord server