
Product
Announcing Socket Fix 2.0
Socket Fix 2.0 brings targeted CVE remediation, smarter upgrade planning, and broader ecosystem support to help developers get to zero alerts.
@polymath-ai/cli
Advanced tools
A Polymath CLI for interacting with all things Polymath.
It wraps the Polymath JS client, and will always be a lean CLI shim on top of that.
You can run a local polymath
cli via npx
, E.g.:
npx polymath -c local-knowledge complete --completion-model gpt-3.5-turbo "How long is a piece of string?"
Download and install the polymath
cli globally:
npm install -g @polymath-ai/cli
Commands will look for options in the following order of precedence:
--config filename
. The CLI will search for the first config file
in the following order:
. --config configpath
: try to load the file
. --config configname
: try to load ~/.polymath/config/$configname.json
~/.polymath/config/default.json
: default config locationOPENAI_API_KEY
There are some global options for all commands:
polymath -d
: turn on debug mode (more output)polymath -c config
: load up the configpolymath -v
: show the versionpolymath -h
: show the helpWe have certain standard arguments that various command reuse:
--input-file
: single file to use as an input--input-directory
: single directory to use an input--output-file
: when outputting a single file (e.g. a library.json)--input
: a type of input (e.g. medium)--output
: a type of output (e.g. pinecone)When arguments aren't given, we will prompt the user for them.
Commands that we do ✅, and will ❌, support:
polymath [-c configfileorname] ask "how long is a piece of string?"
If no query is given, we will ask for one.
It will also takes arguments: ✅
--openai-api-key="the openapi key"
: defaults to $OPENAI_API_KEY
in env / .env--servers https://glazkov.com
: pass as many of these as you want--libraries path/to/libraryOrDirectory
: pass in more of these too--pinecone --pinecone-api-key="The Key" --pinecone-base-url="The URL" --pinecone-namespace=namespace
: use pinecone with all of it's sub settings. If not found, will also look in env / .env (e.g. PINECONE_API_KEY, PINECONE_BASE_URL, PINECONE_NAMESPACE)polymath [-c configfileorname] complete "how long is a piece of string?"
It takes the same arguments as ask
but also uses OpenAI config options and other arguments to overrule them (e.g. max_tokens
, stop
, etc)
stream
a full completion ✅polymath -c local-knowledge complete --completion-stream true --completion-model gpt-3.5-turbo "How long is a piece of string?"
This example turns on streaming, and sets the completion model to the new default turbo mode.
e.g:
polymath import rss https://pau.kinlan.me/index.xml --destination=./libraries/medium-2023.json
polymath ingest ../test/import/html.js https://paul.kinlan.me/
polymath export --input-library=... --output=pinecone --pinecone-api-key="The Key" --pinecone-base-url="The URL" --pinecone-namespace=namespace
Go ahead and great a Polymath Endpoint to get information on what is supported, and do a lil validation check to boot.
polymath info --server https://glazkov.com`
To hack on the CLI, once you git clone, you will probably want to npm link
in the root directory and then you will have access to running the polymath
shell command.
Setup at least a ~/.polymath/config/default.json
and you are off to the races.
FAQs
A CLI for Polymath
We found that @polymath-ai/cli demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 3 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Product
Socket Fix 2.0 brings targeted CVE remediation, smarter upgrade planning, and broader ecosystem support to help developers get to zero alerts.
Security News
Socket CEO Feross Aboukhadijeh joins Risky Business Weekly to unpack recent npm phishing attacks, their limited impact, and the risks if attackers get smarter.
Product
Socket’s new Tier 1 Reachability filters out up to 80% of irrelevant CVEs, so security teams can focus on the vulnerabilities that matter.