Skip to content
Open
Show file tree
Hide file tree
Changes from 4 commits
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
a53e5a1
Feature:Add tests for json_schema.rs
aryasoni98 Oct 4, 2025
e05e7fa
Feature:Add tests for json_schema.rs
aryasoni98 Oct 4, 2025
d5b2ae3
Merge branch 'main' of https://github.com/aryasoni98/cocoindex
aryasoni98 Oct 4, 2025
33fdd66
Feature:Enable programmatically pass in api_key besides reading from env
aryasoni98 Oct 4, 2025
afb5a96
Resolve merge conflict in src/base/json_schema.rs
aryasoni98 Oct 5, 2025
0059fd8
Moved api_key to Common LlmSpec Layer
aryasoni98 Oct 5, 2025
f7b4dcb
Fix formatting issues for GitHub Actions
aryasoni98 Oct 5, 2025
f48b503
Fix type mismatch error in embed_text.rs
aryasoni98 Oct 5, 2025
059ae69
Fix trailing whitespace formatting issues
aryasoni98 Oct 5, 2025
f55170f
Merge branch 'main' of https://github.com/aryasoni98/cocoindex into i…
aryasoni98 Oct 9, 2025
26b5788
Feature: Enable programmatically pass in api_key besides reading from…
aryasoni98 Oct 9, 2025
ccb1b0f
Feature: Enable programmatically pass in api_key besides reading from…
aryasoni98 Oct 9, 2025
f111615
Feature: Enable programmatically pass in api_key besides reading from…
aryasoni98 Oct 10, 2025
86269ba
Feature: Enable programmatically pass in api_key besides reading from…
aryasoni98 Oct 10, 2025
6466ee1
Feature: Enable programmatically pass in api_key besides reading from…
aryasoni98 Oct 13, 2025
2171e22
Merge main into issue-994: Wrap api_key in TransientAuthEntryReference
aryasoni98 Oct 29, 2025
d181b27
Merge branch 'main' of https://github.com/aryasoni98/cocoindex into i…
aryasoni98 Nov 11, 2025
ae3a0e5
Feature: Enable programmatically pass in api_key besides reading from…
aryasoni98 Nov 11, 2025
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
17 changes: 17 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -146,3 +146,4 @@ azure_storage_blobs = { version = "0.21.0", default-features = false, features =
"hmac_rust",
] }
serde_path_to_error = "0.1.17"
expect-test = "1.5.0"
1 change: 1 addition & 0 deletions python/cocoindex/functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ class EmbedText(op.FunctionSpec):
output_dimension: int | None = None
task_type: str | None = None
api_config: llm.VertexAiConfig | None = None
api_key: str | None = None


class ExtractByLlm(op.FunctionSpec):
Expand Down
1 change: 1 addition & 0 deletions python/cocoindex/functions/_engine_builtin_specs.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ class EmbedText(op.FunctionSpec):
output_dimension: int | None = None
task_type: str | None = None
api_config: llm.VertexAiConfig | None = None
api_key: str | None = None


class ExtractByLlm(op.FunctionSpec):
Expand Down
57 changes: 56 additions & 1 deletion python/cocoindex/llm.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,61 @@ class OpenAiConfig:

org_id: str | None = None
project_id: str | None = None
api_key: str | None = None


@dataclass
class AnthropicConfig:
"""A specification for an Anthropic LLM."""

kind = "Anthropic"

api_key: str | None = None


@dataclass
class GeminiConfig:
"""A specification for a Gemini LLM."""

kind = "Gemini"

api_key: str | None = None


@dataclass
class VoyageConfig:
"""A specification for a Voyage LLM."""

kind = "Voyage"

api_key: str | None = None


@dataclass
class LiteLlmConfig:
"""A specification for a LiteLLM LLM."""

kind = "LiteLlm"

api_key: str | None = None


@dataclass
class OpenRouterConfig:
"""A specification for an OpenRouter LLM."""

kind = "OpenRouter"

api_key: str | None = None


@dataclass
class VllmConfig:
"""A specification for a VLLM LLM."""

kind = "Vllm"

api_key: str | None = None


@dataclass
Expand All @@ -43,4 +98,4 @@ class LlmSpec:
api_type: LlmApiType
model: str
address: str | None = None
api_config: VertexAiConfig | OpenAiConfig | None = None
api_config: VertexAiConfig | OpenAiConfig | AnthropicConfig | GeminiConfig | VoyageConfig | LiteLlmConfig | OpenRouterConfig | VllmConfig | None = None
Loading
Loading