Skip to content

Commit

Permalink
missing docs
Browse files Browse the repository at this point in the history
  • Loading branch information
pelikhan committed Feb 2, 2025
1 parent 058a456 commit 19e13f1
Show file tree
Hide file tree
Showing 5 changed files with 36 additions and 19 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ const { files } = await retrieval.vectorSearch("cats", "**/*.md")

### 🐙 GitHub Models and GitHub Copilot

Run models through [GitHub Models](https://microsoft.github.io/genaiscript/getting-started/configuration#github) or [GitHub Copilot](https://microsoft.github.io/genaiscript/getting-started/configuration/#github-copilot).
Run models through [GitHub Models](https://microsoft.github.io/genaiscript/getting-started/configuration#github) or [GitHub Copilot](https://microsoft.github.io/genaiscript/getting-started/configuration/#github_copilot_chat).

```js
script({ ..., model: "github:gpt-4o" })
Expand Down
16 changes: 13 additions & 3 deletions docs/src/content/docs/getting-started/configuration.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -833,7 +833,7 @@ script({ model: "google:gemini-1.5-pro-latest" })

<LLMProviderFeatures provider="google" />

## GitHub Copilot Chat Models <a id="github-copilot" href=""></a>
## GitHub Copilot Chat Models <a id="github_copilot_chat" href=""></a>

Check warning on line 836 in docs/src/content/docs/getting-started/configuration.mdx

View workflow job for this annotation

GitHub Actions / build

Anchor IDs should use hyphens instead of underscores for consistency.

If you have access to **GitHub Copilot Chat in Visual Studio Code**,
GenAIScript will be able to leverage those [language models](https://code.visualstudio.com/api/extension-guides/language-model) as well.
Expand Down Expand Up @@ -1256,7 +1256,7 @@ script({

<LLMProviderFeatures provider="deepseek" />

## LMStudio
## LM Studio <a href="" id="lmstudio" />

The `lmstudio` provider connects to the [LMStudio](https://lmstudio.ai/) headless server.
and allows to run local LLMs.
Expand Down Expand Up @@ -1319,7 +1319,7 @@ script({

<LLMProviderFeatures provider="lmstudio" />

### LMStudio and Hugging Face Models
### LM Studio and Hugging Face Models

Follow [this guide](https://huggingface.co/blog/yagilb/lms-hf) to load Hugging Face models into LMStudio.

Expand Down Expand Up @@ -1461,6 +1461,16 @@ OPENROUTER_SITE_URL=... # populates HTTP-Referer header
OPENROUTER_SITE_NAME=... # populate X-Title header
```

## LiteLLM

The [LiteLLM](https://docs.litellm.ai/) proxy gateway provides a OpenAI compatible API for running models locally.
Configure the `LITELLM_...` keys to set the key and optionally the base url.

```txt title=".env"
LITELLM_API_KEY="..."
#LITELLM_API_BASE="..."
```

## Hugging Face Transformer.js <a href="" id="transformers" />

This `transformers` provider runs models on device using [Hugging Face Transformers.js](https://huggingface.co/docs/transformers.js/index).
Expand Down
2 changes: 1 addition & 1 deletion docs/src/content/docs/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -373,7 +373,7 @@ const res = await safety.detectPromptInjection(env.vars.input)
<Card title="GitHub Models and GitHub Copilot" icon="github">

Run models through GitHub using [GitHub Models](/genaiscript/getting-started/configuration#github)
or [GitHub Copilot](/genaiscript/getting-started/configuration/#github-copilot).
or [GitHub Copilot](/genaiscript/getting-started/configuration/#github_copilot_chat).

Check warning on line 376 in docs/src/content/docs/index.mdx

View workflow job for this annotation

GitHub Actions / build

Anchor IDs should use hyphens instead of underscores for consistency.

```js wrap
script({ ..., model: "github:gpt-4o" })
Expand Down
2 changes: 1 addition & 1 deletion packages/cli/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ const { files } = await retrieval.vectorSearch("cats", "**/*.md")

### 🐙 GitHub Models and GitHub Copilot

Run models through [GitHub Models](https://microsoft.github.io/genaiscript/getting-started/configuration#github) or [GitHub Copilot](https://microsoft.github.io/genaiscript/getting-started/configuration/#github-copilot-in-visual-studio-code).
Run models through [GitHub Models](https://microsoft.github.io/genaiscript/getting-started/configuration#github) or [GitHub Copilot](https://microsoft.github.io/genaiscript/getting-started/configuration/#github_copilot_chat).

```js
script({ ..., model: "github:gpt-4o" })
Expand Down
33 changes: 20 additions & 13 deletions packages/vscode/src/connectioninfotree.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,26 @@ class ConnectionInfoTreeDataProvider
async getTreeItem(
element: ConnectionInfoTreeData
): Promise<vscode.TreeItem> {
if (element.provider) {
if (element.model) {
const { id, details, url } = element.model
const item = new vscode.TreeItem(id)
const tt: vscode.MarkdownString = (item.tooltip =
new vscode.MarkdownString(
`${details}
${url || ""}
`
))
tt.isTrusted = true
return item
} else if (element.provider) {
const { provider, source, base, models } = element.provider
const item = new vscode.TreeItem(provider)
item.collapsibleState = models?.length
? vscode.TreeItemCollapsibleState.Collapsed
: vscode.TreeItemCollapsibleState.None
item.description = base || ""
item.tooltip = YAMLStringify(source)
item.tooltip = YAMLStringify(element.provider)
item.command = <vscode.Command>{
command: "simpleBrowser.show",
arguments: [
Expand All @@ -46,16 +58,6 @@ class ConnectionInfoTreeDataProvider
],
}
return item
} else if (element.model) {
const { id, details, url } = element.model
const item = new vscode.TreeItem(id)
item.description = details
if (url)
item.command = <vscode.Command>{
command: "vscode.open",
arguments: [this.state.host.toUri(url)],
}
return item
}
return undefined
}
Expand All @@ -74,7 +76,12 @@ class ConnectionInfoTreeDataProvider
return providers.map((provider) => ({ provider }))
}
if (element.provider)
return element.provider.models?.map((model) => ({ model })) || []
return (
element.provider.models?.map((model) => ({
provider: element.provider,
model,
})) || []
)
return undefined
}

Expand Down

0 comments on commit 19e13f1

Please sign in to comment.