From fe03e58892c2b18f7c1266e2a63ca88fa87a58b1 Mon Sep 17 00:00:00 2001 From: antonkulaga Date: Sun, 19 Jan 2025 17:42:38 +0200 Subject: [PATCH] trying to make tests work --- docs/__init__.py | 1 + docs/api.rst | 7 +++++++ docs/conf.py | 28 +++++++++++++++++++++++++++- docs/examples.rst | 7 +++++++ docs/index.rst | 2 ++ docs/requirements.txt | 3 ++- tests/test_chain_of_thought.py | 2 +- 7 files changed, 47 insertions(+), 3 deletions(-) create mode 100644 docs/__init__.py create mode 100644 docs/api.rst create mode 100644 docs/examples.rst diff --git a/docs/__init__.py b/docs/__init__.py new file mode 100644 index 0000000..917251c --- /dev/null +++ b/docs/__init__.py @@ -0,0 +1 @@ +"""Documentation package for just-agents.""" \ No newline at end of file diff --git a/docs/api.rst b/docs/api.rst new file mode 100644 index 0000000..c4b7c59 --- /dev/null +++ b/docs/api.rst @@ -0,0 +1,7 @@ +API Reference +============ + +.. automodule:: just_agents + :members: + :undoc-members: + :show-inheritance: \ No newline at end of file diff --git a/docs/conf.py b/docs/conf.py index 22afbf9..5cb3eb6 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -9,7 +9,18 @@ 'sphinx.ext.autodoc', 'sphinx.ext.napoleon', 'sphinx.ext.viewcode', - 'myst_parser' + 'myst_parser', + 'sphinx.ext.intersphinx' +] + +# Add after the existing extensions +autodoc_mock_imports = [ + 'litellm', + 'pydantic', + 'requests', + 'numpydoc', + 'rich', + 'just_agents' ] # Theme settings @@ -19,4 +30,19 @@ source_suffix = { '.rst': 'restructuredtext', '.md': 'markdown', +} + +# Add any paths that contain templates here, relative to this directory +templates_path = ['_templates'] + +# List of patterns, relative to source directory, that match files and +# directories to ignore when looking for source files +exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store'] + +# The master toctree document +master_doc = 'index' + +# Intersphinx mapping +intersphinx_mapping = { + 'python': ('https://docs.python.org/3', None), } \ No newline at end of file diff --git a/docs/examples.rst b/docs/examples.rst new file mode 100644 index 0000000..76ca894 --- /dev/null +++ b/docs/examples.rst @@ -0,0 +1,7 @@ +Examples +======== + +Here you'll find various examples of how to use just-agents. + +.. toctree:: + :maxdepth: 2 \ No newline at end of file diff --git a/docs/index.rst b/docs/index.rst index 67e2b9c..ff7c6d6 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -6,6 +6,8 @@ Welcome to just-agents documentation! :caption: Contents: readme + api + examples Indices and tables ================== diff --git a/docs/requirements.txt b/docs/requirements.txt index 53fdd06..290321b 100644 --- a/docs/requirements.txt +++ b/docs/requirements.txt @@ -1,3 +1,4 @@ sphinx>=7.0.0 sphinx-rtd-theme>=1.3.0 -myst-parser>=2.0.0 \ No newline at end of file +myst-parser>=2.0.0 +sphinx-autodoc-typehints>=1.25.2 \ No newline at end of file diff --git a/tests/test_chain_of_thought.py b/tests/test_chain_of_thought.py index 2038d0d..26d4eeb 100644 --- a/tests/test_chain_of_thought.py +++ b/tests/test_chain_of_thought.py @@ -15,7 +15,7 @@ def count_letters(character: str, word: str) -> str: def test_function_query(): load_dotenv(override = True) - llm_options = just_agents.llm_options.LLAMA3_3 + llm_options = just_agents.llm_options.OPENAI_O1_MINI agent: ChainOfThoughtAgent = ChainOfThoughtAgent(llm_options=llm_options, tools=[count_letters]) result, thoughts = agent.think("Count the number of occurrences of the letter 'L' in the word - 'LOLLAPALOOZA'.") print("Thoughts: ", thoughts)