Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SSA code migration/refactoring incl foundational OODA problem-solving loop #26

Merged
merged 5 commits into from
Nov 29, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .bumpversion.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ current_version = 0.1.6
commit = False
tag = True

[bumpversion:file:openssm/VERSION]
[bumpversion:file:openssa/VERSION]

[bumpversion:file:pyproject.toml]

Expand Down
2 changes: 1 addition & 1 deletion .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
name: Pull request
about: Contribute to the OpenSSM project
about: Contribute to the SSA project

---

Expand Down
7 changes: 6 additions & 1 deletion .github/workflows/make_test.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
name: Run Make Test on PRs
name: Run Make Test

on:
push:
branches:
- "*"

pull_request:
branches:
- "*"
Expand All @@ -13,6 +17,7 @@ jobs:
matrix:
python-version:
- '3.10'
- 3.11

steps:
- name: Checkout Repo
Expand Down
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,13 @@ package-lock.json
**/favicon/test
.env
.openssm
.openssa
__pycache__
/debug.py
/mkdocs.yml
/requirements.txt

tmp

# Streamlit secrets
secrets.toml
2 changes: 1 addition & 1 deletion CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

This code of conduct outlines our expectations for all those who participate in our community, as well as the consequences for unacceptable behavior.

We invite all those who participate in OpenSSM to help us create safe and positive experiences for everyone.
We invite all those who participate in OpenSSA to help us create safe and positive experiences for everyone.

## Expected Behavior

Expand Down
8 changes: 4 additions & 4 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
# Contributing to OpenSSM
# Contributing to OpenSSA

Thanks for your interest in contributing to OpenSSM! This document provides guidelines for contributing to the project. Please read these guidelines before submitting a contribution.
Thanks for your interest in contributing to OpenSSA! This document provides guidelines for contributing to the project. Please read these guidelines before submitting a contribution.

## Code of Conduct

All contributors must abide by the [Code of Conduct](CODE_OF_CONDUCT.md). Please read it before contributing.

## How to Contribute

1. **Find an issue to work on:** Look at the list of open issues in the OpenSSM repository. Pick one that interests you and that no one else is working on.
1. **Find an issue to work on:** Look at the list of open issues in the OpenSSA repository. Pick one that interests you and that no one else is working on.

2. **Fork the repository and create a branch:** If you're not a project maintainer, you'll need to create a fork of the repository and create a branch on your fork where you can make your changes.

3. **Submit a pull request:** After you've made your changes, submit a pull request to merge your branch into the main OpenSSM repository. Be sure to link the issue you're addressing in your pull request.
3. **Submit a pull request:** After you've made your changes, submit a pull request to merge your branch into the main OpenSSA repository. Be sure to link the issue you're addressing in your pull request.

Please ensure your contribution meets the following guidelines:

Expand Down
12 changes: 6 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ export OPENAI_API_URL?=DUMMY_OPENAI_API_URL
# Make sure we include the library directory
PROJECT_DIR=$(PWD)
ROOT_DIR=$(PROJECT_DIR)
LIB_DIR=$(PROJECT_DIR)/openssm
LIB_DIR=$(PROJECT_DIR)/openssa
TESTS_DIR=$(PROJECT_DIR)/tests
EXAMPLES_DIR=$(PROJECT_DIR)/examples
DIST_DIR=$(PROJECT_DIR)/dist
Expand Down Expand Up @@ -63,7 +63,7 @@ test-js:
cd $(TESTS_DIR) && npx jest


LINT_DIRS = openssm tests examples
LINT_DIRS = openssa tests examples
lint: lint-py lint-js

lint-py:
Expand Down Expand Up @@ -181,8 +181,8 @@ pip-install: requirements.txt

oss-publish:
@echo temporary target
# rsync -av --delete --dry-run ../ssm/ ../openssm/
rsync -av --exclude .git --delete ../ssm/ ../openssm/
# rsync -av --delete --dry-run ../ssa/ ../openssa/
rsync -av --exclude .git --delete ../ssa/ ../openssa/

#
# For web-based documentation
Expand All @@ -191,10 +191,10 @@ oss-publish:
docs: docs-build

docs-build:
@cd docs && make build
@PYTHONPATH=$(PYTHONPATH) cd docs && make build

docs-deploy: docs-build
@cd docs && make deploy
@PYTHONPATH=$(PYTHONPATH) cd docs && make deploy

#
# For version management
Expand Down
2 changes: 1 addition & 1 deletion docs/.gitignore
Original file line number Diff line number Diff line change
@@ -1 +1 @@
openssm/
openssa/
33 changes: 22 additions & 11 deletions docs/Makefile
Original file line number Diff line number Diff line change
@@ -1,9 +1,14 @@
PROJECT_DIR := $(shell cd .. && pwd)
OPENSSM_DIR=$(PROJECT_DIR)/openssm
INIT_PY=$(OPENSSM_DIR)/__init__.py
TMP_INIT_PY=$(OPENSSM_DIR)/__tmp__init__.py
OPENSSA_DIR=$(PROJECT_DIR)/openssa
INIT_PY=$(OPENSSA_DIR)/__init__.py
TMP_INIT_PY=$(OPENSSA_DIR)/__tmp__init__.py
DOCS_DIR=$(PROJECT_DIR)/docs
SITE_DIR=$(PROJECT_DIR)/site
VERSION := $(shell cd $(OPENSSA_DIR) && cat VERSION)

#MKDOCS=mkdocs -v
MKDOCS=mkdocs
PYTHONPATH=$(PROJECT_DIR):$(OPENSSA_DIR)

# Colorized output
ANSI_NORMAL="\033[0m"
Expand All @@ -16,22 +21,28 @@ ANSI_CYAN="\033[0;36m"
ANSI_WHITE="\033[0;37m"


PYTHONPATH=$(PROJECT_DIR):$(OPENSSA_DIR)


build:
@echo $(ANSI_YELLOW) $(PYTHONPATH)
@echo $(ANSI_GREEN) ... Generating API navigation $(ANSI_NORMAL)
python api_nav.py
@echo $(ANSI_GREEN) ... Building docs $(ANSI_NORMAL)
@make move-files
# @make move-files
@make copy-files
cd .. && mkdocs build
@make unmove-files
cd .. && $(MKDOCS) build
# @make unmove-files

serve:
@# cd .. && mkdocs serve
cd $(SITE_DIR) && python3 -m http.server 8000
@# cd .. && $(MKDOCS) serve
# cd $(SITE_DIR) && python3 -m http.server 8000
cd $(SITE_DIR) && mike serve

deploy: build
#cd .. && mkdocs gh-deploy
cd .. && ghp-import -p $(SITE_DIR)
#cd .. && $(MKDOCS) gh-deploy
# cd .. && ghp-import -p $(SITE_DIR)
cd .. && mike deploy $(VERSION) latest --deploy-prefix $(VERSION)

install-mkdocs:
pip install mkdocs
Expand All @@ -54,7 +65,7 @@ copy-files:
@echo $(ANSI_GREEN) ... Generating our index.md from ../README.md $(ANSI_NORMAL)
sed -e 's#\(\.\./\)*docs/#/#g' ../README.md > index.md
@echo $(ANSI_GREEN) ... Working on other files $(ANSI_NORMAL)
FILE=openssm/integrations/llama_index/README.md ;\
FILE=openssa/integrations/llama_index/README.md ;\
sed -e 's#\.\./\(\.\./\)*docs/#/#g' $(PROJECT_DIR)/$$FILE > $(DOCS_DIR)/$$FILE

move-files:
Expand Down
10 changes: 5 additions & 5 deletions docs/api_nav.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@


DOCS_DIR = '.'
SRC_DIR = '../openssm'
API_DIR = './openssm'
SRC_DIR = '../openssa'
API_DIR = './openssa'
NAV_PATH = '/tmp/api_nav.yml'
MKDOCS_INC_PATH = DOCS_DIR + '/mkdocs.yml.inc'
MKDOCS_PATH = DOCS_DIR + '/../mkdocs.yml'

INDENT_SPACES = 2
MODULE_PATH_PREFIX = 'openssm/'
MODULE_PATH_PREFIX = 'openssa/'
EXCLUDES = ('deprecated', '__pycache__', '__init__.py')
EMPTY_MD = 'empty.md'

Expand Down Expand Up @@ -77,7 +77,7 @@ def generate_mkdocs_config(nav_path, src_dir, api_dir, indent_spaces):
empty_md_path = os.path.join(empty_md_dir, 'EMPTY.md')
with open(empty_md_path, 'w') as empty_md_file:
empty_md_file.write("This directory is (still) empty.\n")
nav_file.write(f'{indent}- {module_name}: openssm/{empty_md_path.replace(api_dir+"/", "")}\n')
nav_file.write(f'{indent}- {module_name}: openssa/{empty_md_path.replace(api_dir+"/", "")}\n')


else:
Expand All @@ -90,7 +90,7 @@ def generate_mkdocs_config(nav_path, src_dir, api_dir, indent_spaces):
module_path = os.path.join(root.replace(src_dir, '').lstrip('/'), file.replace('.py', ''))
nav_file.write(
f'{indent + " " * indent_spaces}- {file.replace(".py", "")}: '
f'openssm/{module_path.replace(".py", ".md")}.md\n')
f'openssa/{module_path.replace(".py", ".md")}.md\n')


def generate_api_reference(root, file, api_dir):
Expand Down
2 changes: 1 addition & 1 deletion docs/dev/design_principles.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# OpenSSM Design Principles
# A Design Principles

1. **Specialization Over Generalization:** Our models are designed to be domain-specific to provide precise solutions to specific problems, rather than providing generalized solutions.

Expand Down
20 changes: 15 additions & 5 deletions docs/mkdocs.yml.inc
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
site_name: OpenSSM Documentation
site_name: OpenSSA Documentation

theme: windmill
#theme: material
Expand All @@ -23,17 +23,27 @@ extra_css:

plugins:
- search
- mike:
# These fields are all optional; the defaults are as below...
alias_type: symlink
redirect_template: null
deploy_prefix: ''
canonical_version: null
version_selector: true
css_dir: css
javascript_dir: js
- mkdocstrings:
handlers:
python:
paths: [/Users/ctn/src/aitomatic/ssm]
setup_commands:
- import os
- import sys
- sys.path.append('openssm')
- sys.path.append('openssa')
- sys.path.insert(0, os.path.abspath('.'))
- print(sys.path)
- print(f"sys.path is {sys.pat}")
options:
show_source: False
show_source: True
nav:
- Home: index.md
- Getting Started: GETTING_STARTED.md
Expand All @@ -42,7 +52,7 @@ nav:
- Using Makefile: dev/makefile_info.md
- Other HowTos: dev/howtos.md
- Integrations:
- LlamaIndex: openssm/integrations/llama_index/README.md
- LlamaIndex: openssa/integrations/llama_index/README.md
- Vectara: integrations/vectara.md
- Lepton.AI: integrations/lepton_ai.md
- Community:
Expand Down
1 change: 0 additions & 1 deletion docs/resources/favicon/test

This file was deleted.

2 changes: 1 addition & 1 deletion examples/.gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
**/tmp
.openssm
.openssa
token.json
2 changes: 1 addition & 1 deletion examples/chatssm/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ APPNAME=$(notdir $(CURDIR))
# Make sure we include the library directory
PROJECT_DIR=.
ROOT_DIR=$(PROJECT_DIR)/../..
OPENSSM_DIR=$(ROOT_DIR)/openssm
OPENSSM_DIR=$(ROOT_DIR)/openssa
TESTS_DIR=$(ROOT_DIR)/tests
EXAMPLES_DIR=$(ROOT_DIR)/examples
PORT=8080
Expand Down
2 changes: 1 addition & 1 deletion examples/chatssm/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
# OpenSSM/examples/chatssm/__init__.py
# OpenSSA/examples/chatssm/__init__.py
4 changes: 2 additions & 2 deletions examples/chatssm/config.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import os
from openssm import Config
from openssa import Config


# Logging.set_log_level(logging.INFO)
Expand All @@ -10,7 +10,7 @@

# other config variables...

# These are already automatically done in the openssm/core/config.py file
# These are already automatically done in the openssa/core/config.py file
# Override them here if you want to use different values
# Config.OPENAI_API_KEY = os.getenv("OPENAI_API_KEY")
# Config.OPENAI_API_URL = os.getenv("OPENAI_API_URL")
Expand Down
8 changes: 4 additions & 4 deletions examples/chatssm/routes.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@

from flask import render_template, request, Blueprint, session

from openssm import (
from openssa import (
BaseSSM,
GPT3CompletionSSM, GPT3ChatCompletionSSM,
OpenAIGPT3CompletionSSM, OpenAIGPT3ChatCompletionSSM,
Falcon7bSSM
)

Expand All @@ -20,8 +20,8 @@ def home():


ssms = {
'gpt3_completion': GPT3CompletionSSM(),
'gpt3_chat_completion': GPT3ChatCompletionSSM(),
'gpt3_completion': OpenAIGPT3CompletionSSM(),
'gpt3_chat_completion': OpenAIGPT3ChatCompletionSSM(),
'falcon7b': Falcon7bSSM(),
}

Expand Down
6 changes: 3 additions & 3 deletions examples/integrations/lepton_ai.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,13 @@
"metadata": {},
"outputs": [],
"source": [
"# Import OpenSSM package \"live\" from the source code\n",
"# Import OpenSSA package \"live\" from the source code\n",
"import sys\n",
"from pathlib import Path\n",
"sys.path.insert(0, str(Path('../../').resolve()))\n",
"\n",
"# Configure logging for some informative output\n",
"# from openssm import Logs, logger\n",
"# from openssa import Logs, logger\n",
"# logger.setLevel(logger.WARNING)"
]
},
Expand All @@ -31,7 +31,7 @@
"metadata": {},
"outputs": [],
"source": [
"from openssm import LeptonLlamaIndexSSM\n",
"from openssa import LeptonLlamaIndexSSM\n",
"ssm = LeptonLlamaIndexSSM(name=\"eos\")"
]
},
Expand Down
Loading
Loading