Initial CRAN release of foundryR, a tidy interface to Microsoft Azure AI Foundry.
codebook_diff() now returns a printable character-vector object without writing to the console when assigned; format() provides the plain diff lines.step_foundry_embed(cache = "disk") and foundry_cache_clear() now default to a cache inside the R session's temporary directory. Set cache_dir explicitly for a persistent cache. Existing user-directory caches are not deleted or migrated.foundry_agent_create(), foundry_agents(), foundry_agent_get(), foundry_agent_delete(), and foundry_agent_versions(), plus a new agent argument on foundry_response() (backed by foundry_agent_reference()) that runs a stored agent by name through the project-scoped Responses endpoint (roadmap 2026 H2).foundry_moderate_image(), foundry_protected_material(), foundry_blocklists(), and related blocklist item functions (roadmap 2026 H2).foundry_grader_string_check(), foundry_grader_text_similarity(), foundry_grader_label_model(), foundry_grader_score_model(), and foundry_grader_azure_ai() for builtin.* evaluators), evaluation and run lifecycle functions (foundry_eval_create(), foundry_evals(), foundry_eval_get(), foundry_eval_delete(), foundry_eval_run_create(), foundry_eval_runs(), foundry_eval_run_get(), foundry_eval_run_cancel()), and foundry_eval_run_output_items(), which returns per-row grader scores as a tibble (roadmap 2026 H2).foundry_protected_code() for protected-material-in-code detection, foundry_moderate_multimodal() for image-with-text moderation, and foundry_task_adherence() (with foundry_agent_tool(), foundry_agent_tool_call(), and foundry_agent_message() builders) for agent task-adherence checks (roadmap 2026 H2).foundry_conversation_create(), foundry_conversations(), foundry_vector_store_create(), foundry_vector_search(), and foundry_tool_file_search() (roadmap 2026 H2).foundry_codebook() and codebook_diff() for versioned measurement-layer codebooks with deterministic SHA-256 hashes, schema helper wrappers, print output, and codebook diffs (measurement layer M1).foundry_schema(), schema_string(), schema_enum(), schema_number(), schema_integer(), schema_boolean(), schema_array(), schema_object(), and as_foundry_schema() for strict structured-output schemas (roadmap 2026 H2).foundry_agreement(), foundry_consistency(), and foundry_provenance() for publication-oriented annotation checks and reproducibility metadata (roadmap 2026 H2).foundry_batch_create(), foundry_batches(), foundry_batch_get(), foundry_batch_cancel(), and foundry_batch_requests() for large-scale prompt, annotation, extraction, and classification jobs.foundry_file_upload(), foundry_files(), foundry_file_get(), foundry_file_delete(), and foundry_file_download() for Batch, eval, fine-tuning, and file-search workflows.foundry_agent() and foundry_tool() for a bounded Responses API function-calling loop with user-defined R tools.foundry_batch_results(), foundry_batch_wait(), foundry_extract_batch(), and foundry_usage() to complete the batch annotation loop from JSONL requests through parsed tibble results and user-supplied cost summaries (roadmap 2026 H2).foundry_image_edit() for v1 preview image editing with local image and optional mask uploads.foundry_response_cancel() and foundry_response_input_items() for background Responses API workflows and response introspection (roadmap 2026 H2).foundry_set_project_endpoint(), foundry_get_project_endpoint(), foundry_set_token_provider(), and foundry_token_azure_cli() for project-scoped APIs and refreshable Microsoft Entra authentication (roadmap 2026 H2).foundry_token_azure_identity(), a refreshable Microsoft Entra ID token provider backed by \pkg{AzureAuth} that supports service principals, managed identity, and interactive or device-code flows (roadmap 2026 H2).foundry_set_speech_endpoint(), foundry_set_speech_key(), foundry_transcribe(), and foundry_translate_audio() for LLM Speech and MAI-Transcribe workflows.foundry_set_token() for Microsoft Entra ID bearer-token authentication across Foundry requests.foundry_speak() for v1 preview text-to-speech output saved to local audio files.foundry_cache_clear() to remove embeddings cached on disk by step_foundry_embed(cache = "disk") (roadmap 2026 H2).foundry_video_job_create(), foundry_video_jobs(), foundry_video_job_get(), foundry_video_job_delete(), foundry_video_get(), and foundry_video_download() for preview video job management and content downloads.store = TRUE now persist under tools::R_user_dir("foundryR", "config") instead of modifying .Renviron; the API support matrix and CRAN submission runbook now document lifecycle and release boundaries (CRAN readiness).foundry_moderate(), foundry_moderate_image(), and foundry_protected_material() now accept resource-scoped Microsoft Entra token providers in addition to Content Safety API keys (CRAN readiness).foundry_response() and its retrieve, cancel, delete, and input-item helpers now accept an explicit project_endpoint, keeping agent-backed response lifecycles on one project endpoint (CRAN readiness).foundry_token_azure_cli(), foundry_token_azure_identity(), foundry_set_token(), and foundry_set_token_provider() now separate resource and project authentication, default resource tokens to the documented Cognitive Services audience, and use the AI audience only for project operations (CRAN readiness).step_foundry_embed() now checks for \pkg{recipes} before generating its default step identifier, and \pkg{generics} is declared for its exported tidy() method (CRAN readiness).
foundry_groundedness() now supports the Content Safety correction feature via correction = TRUE with a bring-your-own Azure OpenAI deployment described by the new foundry_llm_resource(), returning a correction_text column, and surfaces per-segment ungrounded_reasons when reasoning = TRUE (roadmap 2026 H2).
as_foundry_schema() now converts ellmer::type_object() specifications to strict JSON Schema, so ellmer users can reuse existing type definitions in foundry_extract() and foundry_response() (roadmap 2026 H2).
foundry_agreement() now reports Krippendorff's alpha alongside Cohen's and Fleiss' kappa, using \pkg{irr} when installed and a base-R nominal fallback otherwise (roadmap 2026 H2).foundry_chat() now accepts reasoning_effort and returns reasoning_tokens and cached_input_tokens when chat-completions responses report those fields.foundry_chat() now defaults to the /openai/v1/chat/completions endpoint while keeping api = "deployment" as a legacy escape hatch (roadmap 2026 H2).foundry_embed() now uses the /openai/v1/embeddings array endpoint by default, returns row-level .error and .error_msg fields, and keeps api = "deployment" as a legacy escape hatch (roadmap 2026 H2).foundry_extract() now accepts data frames with text_col, preserves original columns, runs requests in parallel, and returns parse or HTTP failures as .error rows instead of aborting the whole job (roadmap 2026 H2).foundry_image() now uses the v1 preview image generation endpoint by default, supports newer image options such as output_format, output_compression, background, and moderation, and keeps the legacy deployment endpoint available with api = "deployment".foundry_moderate() now supports Content Safety blocklists and keeps raw response payloads in list-columns (roadmap 2026 H2).foundry_models() now calls the v1 model and deployment metadata endpoints instead of sending a dummy chat request.foundry_response() now accepts background, conversation, prompt-cache, parallel-tool-call, max-tool-call, safety-identifier, and reasoning-summary controls from the v1 Responses API (roadmap 2026 H2).foundry_response() accepts foundry_tool() objects in tools, strips local R function references from request bodies, and returns cached_input_tokens when the Responses API reports cached input tokens.foundry_similarity() now computes all pairwise cosine similarities with a single vectorized matrix product, supports top_k, and can return a similarity matrix with as_matrix = TRUE (roadmap 2026 H2).step_foundry_embed() now supports cache = "disk" with an optional cache_dir to persist embeddings across bakes, and builds embedding columns from a single matrix instead of a per-cell fill loop (roadmap 2026 H2).foundry_transcribe(), foundry_translate_audio(), and foundry_speak() now accept api = "deployment" to reach OpenAI audio models through the /openai/deployments/{model}/... path, so a whisper transcription or translation deployment works alongside the default v1 data-plane path.data-raw/record-doc-outputs.R, which captures every API response as a sanitized \pkg{httptest2} fixture; all later builds (R CMD check, pkgdown, CRAN, CI) replay those fixtures and render the real tibbles, images, and audio with no credentials and no network calls. When fixtures are absent the API chunks simply do not evaluate, so nothing is fabricated.foundry_embed(), ranks occupations by semantic similarity, and summarizes the top match with foundry_chat(); the redactor now strips the O*NET X-API-Key header so its fixtures carry no secrets.Any scripts or data that you put into this service are public.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.