You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Feature: Enable programmatically pass in api_key besides reading from env (#1134)
* Feature:Add tests for json_schema.rs
* Feature:Enable programmatically pass in api_key besides reading from env
* Moved api_key to Common LlmSpec Layer
* Fix formatting issues for GitHub Actions
- Fixed Python line length issue in llm.py by breaking long type annotation
- Fixed Rust function signature formatting in all LLM client files
- Fixed long function call formatting in embed_text.rs
- All formatting now complies with project standards
* Fix type mismatch error in embed_text.rs
- Fixed api_bail! usage in context expecting LlmApiConfig return type
- Replaced unwrap_or_else with proper if-let pattern matching
- Resolves compilation error in GitHub Actions build test
* Fix trailing whitespace formatting issues
- Removed trailing whitespace from all LLM client files
- Fixed formatting issues in gemini.rs, litellm.rs, openai.rs, openrouter.rs, vllm.rs
- Fixed trailing whitespace in embed_text.rs
- All files now comply with cargo fmt standards
* Feature: Enable programmatically pass in api_key besides reading from env
* Feature: Enable programmatically pass in api_key besides reading from env
* Feature: Enable programmatically pass in api_key besides reading from env
* Feature: Enable programmatically pass in api_key besides reading from env
* Feature: Enable programmatically pass in api_key besides reading from env
* Feature: Enable programmatically pass in api_key besides reading from env
Copy file name to clipboardExpand all lines: docs/docs/ai/llm.mdx
+6Lines changed: 6 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -234,6 +234,12 @@ To use the Vertex AI API:
234
234
gcloud auth application-default login
235
235
```
236
236
237
+
:::note API Key Not Supported
238
+
239
+
Vertex AI does **not** support the `api_key` parameter. Vertex AI uses Application Default Credentials (ADC) for authentication instead of API keys. If you provide an `api_key` parameter when using `LlmApiType.VERTEX_AI`, an error will be raised.
240
+
241
+
:::
242
+
237
243
Spec for Vertex AI takes additional `api_config` field, in type `cocoindex.llm.VertexAiConfig` with the following fields:
238
244
-`project` (type: `str`, required): The project ID of the Google Cloud project.
239
245
-`region` (type: `str`, optional): The region of the Google Cloud project. Use `global` if not specified.
api_bail!("VertexAi API address is not supported for VertexAi API type");
260
265
}
266
+
if api_key.is_some(){
267
+
api_bail!(
268
+
"VertexAi API key is not supported for VertexAi API type. Vertex AI uses Application Default Credentials (ADC) for authentication. Please set up ADC using 'gcloud auth application-default login' instead."
0 commit comments