This commit is contained in:
sanj 2024-07-11 14:29:16 -07:00
commit 39a9375649
15 changed files with 71 additions and 16 deletions

2
.gitignore vendored
View file

@ -10,7 +10,7 @@ sijapi/data/*.pbf
sijapi/data/geonames.txt
sijapi/data/img/images/
sijapi/config/*.yaml
sijapi/config/O365/
sijapi/config/MS365/
sijapi/local_only/
sijapi/testbed/
khoj/

View file

@ -36,7 +36,7 @@
!{!{ YOUR SIJAPI SUBDOMAIN }!}! {
import cors
@public {
path /img/* /oauth /oauth/* /o365 /o365/* /ip /health /health* /health/* /id /identity
path /img/* /oauth /oauth/* /MS365 /MS365/* /ip /health /health* /health/* /id /identity
}
@apiKeyAuthHeader {
header Authorization "Bearer !{!{ YOUR GLOBAL_API_KEY }!}!"

View file

@ -291,7 +291,7 @@ MS365_SECRET=¿SECRET? # <--- enter your app secret (found in Azure
MS365_SCOPE='basic,calendar_all,Calendars.Read,Calendars.ReadWrite,offline_access'
MS365_TOKEN_FILE=oauth_token.txt
MS365_LOGIN_URL='https://login.microsoftonline.com'
MS365_REDIRECT_PATH=¿SECRET? # <--- e.g. http://localhost:4444/o365/oauth_redirect
MS365_REDIRECT_PATH=¿SECRET? # <--- e.g. http://localhost:4444/MS365/oauth_redirect
#─── notes: ───────────────────────────────────────────────────────────────────────────────
#
# # MS365_CLIENT_ID, _TENANT_ID, _SECRET, AND _SCOPES must be obtained from Microsoft

View file

@ -0,0 +1,11 @@
DIR: '{{ DIR.HOME }}/whisper.cpp'
MODELS:
- small
- base
- base-en
- tiny
- medium
- medium-en
- large
- large-v2
- large-v3

View file

@ -0,0 +1,19 @@
MS365:
STATUS: OFF
AUTH:
TENANT: bad78048-a6e0-47b1-a24b-403c444aa349
CLIENT_ID: ce8cbd24-f146-4dc7-8ee7-51d9b69dec59
LOGIN: 'https://login.microsoftonline.com'
REDIRECT: 'https://api.sij.ai/MS365/oauth_redirect'
SCOPES:
- basic
- calendar_all
- Calendars.Read
- Calendars.ReadWrite
- offline_access
SECRET: '{{ SECRET.MS365_SECRET }}'
TOKEN_FILE: '{{ DIR.CONFIG }}/ms365/oauth_token.txt'
ICAL:
STATUS: ON
CALENDARS:
- ''

View file

@ -0,0 +1,6 @@
url:
base: 'https://www.courtlistener.com'
dockets: '{{ url.base }}/api/rest/v3/dockets/'
API_KEY: '{{ SECRET.COURTLISTENER_API_KEY }}'
DOCKETS: '{{ DIR.DATA }}/cl/dockets'
SEARCHES: '{{ DIR.DATA }}/cl/searches'

View file

@ -1,6 +0,0 @@
HOME: ~
BASE: '{{ HOME }}/sijapi'
SIJAPI: '{{ BASE }}/sijapi'
CONFIG: '{{ SIJAPI }}/config'
DATA: '{{ SIJAPI }}/data'
LOGS: '{{ SIJAPI }}/logs'

View file

@ -0,0 +1,17 @@
url: http://localhost:11434
sys: 'You are a helpful AI assistant.'
tpw: 1.3s
chat:
model: dolphin-mistral
vision:
model: llava-llama3
summary:
model: dolphin-llama3:8b-256k
chunk-size: 16384
chunk-overlap: 256
length-ratio: 4
min-length: 64
token-limit: 16384
instruct: 'You are an AI assistant that provides accurate summaries of text -- nothing more and nothing less. You must not include ANY extraneous text other than the sumary. Do not include comments apart from the summary, do not preface the summary, and do not provide any form of postscript. Do not add paragraph breaks. Do not add any kind of formatting. Your response should begin with, consist of, and end with an accurate plaintext summary.'
functions:
model: 'command-r'

View file

@ -0,0 +1,6 @@
DAILY_NOTE:
YEAR: '%Y'
MONTH: '%Y-%m %B'
DAY: '%Y-%m-%d %A'
DAY_SHORT: '%Y-%m-%d'
DIR: '{{ HOME_DIR }}/Nextcloud/notes' # you can specify the absolute path or use '{{ HOME_DIR }}' followed by a relative path

View file

@ -0,0 +1,6 @@
ID: sij-mbp16
IP: 100.64.64.20
SUBNET: 100.64.64.0/24
MDNS: starling-sailfin.ts.net
API_KEY: '{{ SECRET.TAILSCALE_API_KEY }}'
ADDRESS: 'http://{{ ID }}.{{ MDNS }}'

View file

@ -131,12 +131,10 @@ async def add_config(record: DNSRecordRequest):
raise HTTPException(status_code=400, detail=f"Failed to create A record: {error_message} (Code: {error_code})")
# Update Caddyfile
await update_caddyfile(full_domain, caddy_ip, port)
await update_caddyfile(full_domain, caddy_ip, port)
return {"message": "Configuration added successfully"}
@cf.get("/cf/list_zones")
async def list_zones_endpoint():
domains = await list_zones()

View file

@ -405,7 +405,7 @@ async def load_workflow(workflow_path: str, workflow:str):
return json.load(file)
async def update_prompt_and_get_key(workflow: dict, post: dict, positive: str):
async def update_prompt_and_get_key(workf0ow: dict, post: dict, positive: str):
'''
Recurses through the workflow searching for and substituting the dynamic values for API_PrePrompt, API_StylePrompt, API_NegativePrompt, width, height, and seed (random integer).
Even more important, it finds and returns the key to the filepath where the file is saved, which we need to decipher status when generation is complete.

View file

@ -13,7 +13,7 @@ from zoneinfo import ZoneInfo
from dateutil.parser import parse as dateutil_parse
from typing import Optional, List, Union
from datetime import datetime
from sijapi import L, DB, TZ, NAMED_LOCATIONS, GEO
from sijapi import L, DB, TZ, GEO
from sijapi.classes import Location
from sijapi.utilities import haversine

View file

@ -26,8 +26,6 @@ from fastapi.responses import JSONResponse
from pydantic import BaseModel
from pathlib import Path
from sijapi.classes import Configuration
from sijapi import API, L, Dir, News, OBSIDIAN_VAULT_DIR, OBSIDIAN_RESOURCES_DIR, OBSIDIAN_BANNER_SCENE, DEFAULT_11L_VOICE, DEFAULT_VOICE, GEO
from sijapi.utilities import sanitize_filename, assemble_journal_path, assemble_archive_path
from sijapi.routers import llm, tts, asr, loc