Skip to content

docs(js): session-auth switch for the RAG sample; structured-output naming note - #309

Open
fede-kamel wants to merge 1 commit into
oracle:mainfrom
fede-kamel:docs/js-followups-session-auth-config-name
Open

docs(js): session-auth switch for the RAG sample; structured-output naming note#309
fede-kamel wants to merge 1 commit into
oracle:mainfrom
fede-kamel:docs/js-followups-session-auth-config-name

Conversation

@fede-kamel

Copy link
Copy Markdown
Member

Two small follow-ups from the #301 and #303 reviews.

RAG sample: OCI_AUTH_TYPE. The sample hardcoded OciGenAiNewClientAuthType.ConfigFile, so it could only run with API-key credentials. A new OCI_AUTH_TYPE env var (ConfigFile, the default, or Session) selects the auth type, which lets the sample run with a profile created by oci session authenticate. Unknown values fail fast with a clear error. README table updated.

libs/js/oci README: structured output naming. withStructuredOutput binds a function named after the schema, or extract when the schema has no name. When the schema has a top-level field literally called name, Llama 3.3 was observed filling that field with the function name; GPT-4o was not. The README now recommends passing an explicit name in that case.

Verification: the sample type-checks and runs end to end with OCI_AUTH_TYPE=Session against Oracle AI Database 26ai Free and OCI GenAI (ingestion, IVF index, retrieval, cited answer from xai.grok-4.20); an invalid OCI_AUTH_TYPE is rejected with the intended message; pnpm format:check passes for the README.

…aming note

- samples/rag_pipeline: new OCI_AUTH_TYPE env (ConfigFile, the default, or
  Session) selects the langchain-oci auth type, so the sample also runs with a
  profile created by `oci session authenticate` (security_token_file) instead
  of only API-key config-file auth. Unknown values fail fast with a clear
  message. README table updated.
- libs/js/oci README: structured output binds a function named after the
  schema (or `extract`); recommend passing an explicit `name` when the schema
  has a top-level field called `name`, since smaller models can confuse the
  two.

Verified: sample type-checks and runs end to end with OCI_AUTH_TYPE=Session
against Oracle AI Database 26ai and OCI GenAI (xai.grok-4.20 answer with
citation); README passes the package's prettier check.
@oracle-contributor-agreement oracle-contributor-agreement Bot added the OCA Verified All contributors have signed the Oracle Contributor Agreement. label Sep 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

OCA Verified All contributors have signed the Oracle Contributor Agreement.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant