Skip to content

Commit

Permalink
Merge branch 'refs/heads/dev'
Browse files Browse the repository at this point in the history
# Conflicts:
#	openbrain/tools/obtool.py
#	openbrain/tools/tool_event_mesh_tester.py
#	openbrain/tools/tool_input_and_context_tester.py
#	openbrain/tools/tool_leadmo_create_appointment.py
#	openbrain/tools/tool_leadmo_create_contact.py
#	openbrain/tools/tool_leadmo_get_contact_info_from_context.py
#	openbrain/tools/tool_leadmo_get_simple_calendar_appointment_slots.py
#	openbrain/tools/tool_leadmo_stop_conversation.py
#	openbrain/tools/tool_leadmo_update_contact.py
#	openbrain/tools/tool_lls_scrub_phone_number.py
#	openbrain/tools/tool_simple_calculator.py
  • Loading branch information
svange committed Jul 26, 2024
2 parents 2629513 + 50439f4 commit 768da68
Show file tree
Hide file tree
Showing 145 changed files with 2,758 additions and 442 deletions.
2 changes: 2 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
name: 🚀 Feature request
description: Suggest an idea for this project
title: "<One feature request per issue>"
projects:
- "svange/openbrain"
labels: [feature]
body:
- type: textarea
Expand Down
26 changes: 24 additions & 2 deletions .github/workflows/pipeline.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ jobs:

deploy-infrastructure:
name: Deploy infrastructure
if: false
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
Expand Down Expand Up @@ -162,13 +163,20 @@ jobs:
#----------------------------------------------
- name: Test with pytest
run: |
poetry run pytest tests -m ci_cd
poetry run pytest tests -m "not redundant and not tools and not remote_tests"
- name: upload pytest.log
uses: actions/upload-artifact@v4
with:
name: pytest.log
path: pytest.log


- name: Skip tests if release commit
run: echo "Skipping tests for release commit"

publish-prerelease:
if: false && github.ref == 'refs/heads/dev'
if: github.ref == 'refs/heads/dev'
needs: [run-tests]
runs-on: ubuntu-latest
name: Publish to PyPi test
Expand Down Expand Up @@ -271,3 +279,17 @@ jobs:
pypi_token: ${{ secrets.PYPI_TOKEN }}
release_branch: ${{ github.ref_name }}
github_token: ${{ secrets.GH_TOKEN }}

deploy_docs:
needs: [publish-release]
uses: ./.github/workflows/publish_docs.yml
secrets: inherit

deploy_docs_prerelease:
needs: [publish-prerelease]
uses: ./.github/workflows/publish_docs.yml
secrets: inherit

deploy_docs_now:
uses: ./.github/workflows/publish_docs.yml
secrets: inherit
98 changes: 98 additions & 0 deletions .github/workflows/publish_docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
name: Deploy Sphinx documentation to Pages

on:
workflow_call:
# inputs:
# version:
# description: 'Version of the documentation to build'
# required: true
# type: string
# secrets: inherit

env:
GH_TOKEN: ${{ secrets.GH_TOKEN }}

jobs:
pages:
runs-on: ubuntu-20.04
steps:
- name: print inputs
run: |
echo ${{ inputs.version }}
#----------------------------------------------
# check-out repo and set-up python
#----------------------------------------------
- name: Check out repository
uses: actions/checkout@v4
- name: Set up python
id: setup-python
uses: actions/setup-python@v5
with:
python-version: '3.10'

#----------------------------------------------
# ----- install & configure poetry -----
#----------------------------------------------
- name: Install Poetry
uses: snok/install-poetry@v1
with:
virtualenvs-create: true
virtualenvs-in-project: true
installer-parallel: true

#----------------------------------------------
# load cached venv if cache exists
#----------------------------------------------
- name: Load cached venv

id: cached-poetry-dependencies
uses: actions/cache@v4
with:
path: .venv
key: venv-${{ runner.os }}-${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('**/poetry.lock') }}
#----------------------------------------------
# install dependencies if cache does not exist
#----------------------------------------------
- name: Install dependencies
if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true'
run: poetry install --no-interaction --no-root

#----------------------------------------------
# install your root project, if required
#----------------------------------------------
- name: Install project
run: poetry install -E docs --no-interaction
#
# - name: Get version
# id: put_version_in_file
# run: |
# echo "---------------------------------------------------------------------------"
# poetry run semantic-release version --print-last-released-tag >> last_version.txt
# echo "Getting next version"
# echo "---------------------------------------------------------------------------"
# cat last_version.txt
# echo "---------------------------------------------------------------------------"
#
# - name: Set outputs
# id: vars
# run: echo "last_ver=$(head -n1 last_version.txt)" >> $GITHUB_OUTPUT
#
# - name: Check outputs
# run: |
# echo "${{ steps.vars.outputs.last_ver }}"

- name: deploy
run: |
poetry run sphinx-build -b html ./docs/source ./docs/build
# - id: deployment
# uses: sphinx-notes/pages@v3
# with:
# publish: false
# documentation_path: ./docs/source

- uses: peaceiris/actions-gh-pages@v4
with:
github_token: ${{ secrets.GH_TOKEN }}
publish_dir: ./docs/build
20 changes: 20 additions & 0 deletions docs/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Minimal makefile for Sphinx documentation
#

# You can set these variables from the command line, and also
# from the environment for the first two.
SPHINXOPTS ?=
SPHINXBUILD ?= sphinx-build
SOURCEDIR = source
BUILDDIR = build

# Put it first so that "make" without argument is like "make help".
help:
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)

.PHONY: help Makefile

# Catch-all target: route all unknown targets to Sphinx using the new
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
%: Makefile
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
35 changes: 35 additions & 0 deletions docs/make.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
@ECHO OFF

pushd %~dp0

REM Command file for Sphinx documentation

if "%SPHINXBUILD%" == "" (
set SPHINXBUILD=sphinx-build
)
set SOURCEDIR=source
set BUILDDIR=build

%SPHINXBUILD% >NUL 2>NUL
if errorlevel 9009 (
echo.
echo.The 'sphinx-build' command was not found. Make sure you have Sphinx
echo.installed, then set the SPHINXBUILD environment variable to point
echo.to the full path of the 'sphinx-build' executable. Alternatively you
echo.may add the Sphinx directory to PATH.
echo.
echo.If you don't have Sphinx installed, grab it from
echo.https://www.sphinx-doc.org/
exit /b 1
)

if "%1" == "" goto help

%SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%
goto end

:help
%SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%

:end
popd
15 changes: 15 additions & 0 deletions docs/source/_autosummary/openbrain.agents.exceptions.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
openbrain.agents.exceptions
===========================

.. automodule:: openbrain.agents.exceptions


.. rubric:: Exceptions

.. autosummary::

AgentError
AgentToolError
AgentToolIncompleteContactError
AgentToolIncompleteLeadError
AgentToolLeadMomentumError
11 changes: 11 additions & 0 deletions docs/source/_autosummary/openbrain.agents.gpt_agent.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
openbrain.agents.gpt\_agent
===========================

.. automodule:: openbrain.agents.gpt_agent


.. rubric:: Classes

.. autosummary::

GptAgent
14 changes: 14 additions & 0 deletions docs/source/_autosummary/openbrain.agents.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
openbrain.agents
================

.. automodule:: openbrain.agents


.. rubric:: Modules

.. autosummary::
:toctree:
:recursive:

exceptions
gpt_agent
11 changes: 11 additions & 0 deletions docs/source/_autosummary/openbrain.cli.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
openbrain.cli
=============

.. automodule:: openbrain.cli


.. rubric:: Classes

.. autosummary::

CliChatBot
11 changes: 11 additions & 0 deletions docs/source/_autosummary/openbrain.exceptions.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
openbrain.exceptions
====================

.. automodule:: openbrain.exceptions


.. rubric:: Exceptions

.. autosummary::

ObMissingEnvironmentVariable
15 changes: 15 additions & 0 deletions docs/source/_autosummary/openbrain.orm.exceptions.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
openbrain.orm.exceptions
========================

.. automodule:: openbrain.orm.exceptions


.. rubric:: Exceptions

.. autosummary::

OrmAgentInstantiationError
OrmNotImplementedError
OrmProfileNotFoundError
OrmSaveAgentConfigError
OrmSessionNotFoundError
12 changes: 12 additions & 0 deletions docs/source/_autosummary/openbrain.orm.model_agent_config.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
openbrain.orm.model\_agent\_config
==================================

.. automodule:: openbrain.orm.model_agent_config


.. rubric:: Classes

.. autosummary::

AgentConfig
DefaultSettings
11 changes: 11 additions & 0 deletions docs/source/_autosummary/openbrain.orm.model_chat_message.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
openbrain.orm.model\_chat\_message
==================================

.. automodule:: openbrain.orm.model_chat_message


.. rubric:: Classes

.. autosummary::

ChatMessage
11 changes: 11 additions & 0 deletions docs/source/_autosummary/openbrain.orm.model_chat_session.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
openbrain.orm.model\_chat\_session
==================================

.. automodule:: openbrain.orm.model_chat_session


.. rubric:: Classes

.. autosummary::

ChatSession
11 changes: 11 additions & 0 deletions docs/source/_autosummary/openbrain.orm.model_client.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
openbrain.orm.model\_client
===========================

.. automodule:: openbrain.orm.model_client


.. rubric:: Classes

.. autosummary::

Client
20 changes: 20 additions & 0 deletions docs/source/_autosummary/openbrain.orm.model_common_base.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
openbrain.orm.model\_common\_base
=================================

.. automodule:: openbrain.orm.model_common_base


.. rubric:: Functions

.. autosummary::

snake_to_camel_case

.. rubric:: Classes

.. autosummary::

Ephemeral
InMemoryDb
Recordable
Serializable
18 changes: 18 additions & 0 deletions docs/source/_autosummary/openbrain.orm.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
openbrain.orm
=============

.. automodule:: openbrain.orm


.. rubric:: Modules

.. autosummary::
:toctree:
:recursive:

exceptions
model_agent_config
model_chat_message
model_chat_session
model_client
model_common_base
Loading

0 comments on commit 768da68

Please sign in to comment.