文件历史

42 次代码提交

作者 SHA1 备注 提交日期
Rohit Prasad 0ef50c3509 Merge pull request #312 from rakeshutekar/fix-client-provider-configs
Fix shared provider config state across Client instances
2026-07-16 11:16:03 -07:00
Rohit C Prasad 7a7e2f90cd Add streaming support to chat completions (stream=True on create/acreate)
Providers yield unified OpenAI-shaped chunks: OpenAI/Ollama stream natively,
Anthropic events are normalized, and other providers get an async bridge over
any sync stream. Streaming is manual tool calling only (no max_turns/MCP).
2026-07-14 22:36:30 -07:00
Rohit P 8ddb69df04 style: black-format test_async_client.py 2026-06-23 10:54:23 +02:00
Rohit C Prasad 146b8d6301 acreate: pass tool schemas through on the manual path (#266 twin)
Lint / lint (push) Has been cancelled
Lint / build_and_test (3.10) (push) Has been cancelled
Lint / build_and_test (3.11) (push) Has been cancelled
Lint / build_and_test (3.12) (push) Has been cancelled
The async client replicated the manual tool-calling regression fixed in
#266: acreate() pops `tools` from kwargs and never handed them to the
provider when max_turns is absent. Both create() and acreate() now share
a _provider_ready_tools() helper (schema dicts pass through, callables
become OpenAI-format specs) and an async regression test mirrors the
sync one.
2026-06-23 10:34:43 +02:00
Rohit P e907379b7b Add async client core (acreate) with sync wrappers
Add Completions.acreate and an async _atool_runner that await the provider's
achat_completions_create and the async tool execution. Provider resolution,
tool-runner setup, model-event emission, and response finalization are factored
into shared helpers so the sync create/_tool_runner and the async paths stay in
lockstep instead of duplicating the tool loop. MCP client cleanup remains
synchronous via ExitStack.
2026-06-23 10:34:43 +02:00
Rakesh Utekar 5ff8c5bc99 fix(client): isolate provider configs per client
Avoid sharing the default provider config mapping across Client instances and copy caller-provided provider configs before storing or passing them into provider initialization.
2026-06-12 13:03:28 -07:00
Rohit Prasad da327ffbb2 Merge pull request #300 from andrewyng/style/black-everything
Fix CI: black-format the repo and guard tomllib for py3.10
2026-06-10 16:08:47 -07:00
Rohit C Prasad 41b1591f6d style: black-format the entire repo
Mechanical 'black .' over root package and platform/ (109 files; the
Lint workflow checks the whole repo and has been red since platform
landed unformatted, with a few more violations from community merges
whose branches never ran CI). No functional change: full platform
suite (264) and aisuite suites verified unchanged after formatting.
2026-06-10 15:29:23 -07:00
Rohit P 1052620c2e Fix tool calling on Ollama and LM Studio via OpenAI-compatible /v1
The Ollama and LM Studio providers hit the native endpoints and normalized
only `message.content`, silently dropping tool_calls, finish_reason, and
usage — so tool calling never worked on local models.

Drive both through the providers' OpenAI-compatible /v1 endpoint by
subclassing OpenaiProvider, so tool calls, tool-result messages, and
finish_reason flow through the OpenAI SDK unchanged.

- OllamaProvider / LmstudioProvider: subclass OpenaiProvider and point
  base_url at the local /v1 endpoint (host overridable via api_url config or
  OLLAMA_API_URL / LMSTUDIO_API_URL), with a dummy api_key the servers ignore
- pyproject: the ollama and lmstudio extras now require the openai SDK
- tests: rewrite the provider tests to the OpenAI-SDK mock pattern with
  explicit tool-call coverage, plus a client tool-loop test for ollama:
2026-06-10 15:09:43 -07:00
Rohit C Prasad 2c4f9e1897 Repair and extend the manual tool-calling tests
- fix the auto-mode test: it patched client.chat.completions._client,
  an attribute that does not exist (Completions has .client), which
  made patch.object raise before asserting anything
- new test: manual mode with callable tools must hand the provider
  OpenAI-format specs (callables cannot be serialized into a request)
- point the regression reference at PR #266 instead of a placeholder
2026-06-10 15:04:04 -07:00
Devika 9eb22989ba Add Agent API
Introduce a high-level Agent abstraction for aisuite. An Agent pairs a
model with instructions, tools, and run settings, and a Runner drives
the multi-step tool-calling loop over any aisuite-supported provider.

- aisuite/agents: Runner (run_sync / continue_sync) plus typed
  Agent, RunResult, RunState, and RunStep
- Tool policies (ToolPolicyContext / ToolPolicyDecision) to gate
  which tools a run may invoke
- Continuation API to resume a finished run with new input
- aisuite/utils/tools: tool schema generation and execution helpers
- examples/agents/simple_agent.py: minimal end-to-end example
- tests/agents: runner, tool-policy, continuation, and OpenAI
  integration coverage

Co-authored-by: Rohit <rohit.prasad15@gmail.com>
2026-05-30 20:13:00 -07:00
Rohit P 6903d132aa Add HuggingFace Inference API as supported provider for Audio Transcription.
Summary:
HF supports many models which can be used for transcription.
Add support for all models that can be accessed via the HF Inference API.
Examples - openai/whisper-* family, facebook/wav2vec2-* family, and many others.
Updated README, Added Test cases (unit + integration) for the same.
2025-10-14 16:40:02 -07:00
Rohit P ff5e4f3098 Fix lint, tests and missing packages. 2025-10-14 13:02:15 -07:00
Rohit P e2e45d5cfc Fix Lint issues. 2025-10-14 12:40:12 -07:00
Rohit P a7697a42dd Update Deepgram provider to use new v5 library.
Summary -
Deepgram SDK v5 code migration
Pydantic v2 model serialization fix
Test language assertion fix
2025-10-14 12:38:07 -07:00
Rohit P a6a076d62c More unit tests for ASR-python.
Summary of test cases
Core parameter pass-through functionality is fully tested and validated
through unit tests and client integration tests.
test_asr_params.py - ParamValidator logic, mappings, transformations.
test_client.py - Client-level validation, all modes, parameter flow
test_asr_parameter_passthrough.py - OpenAI & Google.
Deepgram mock test will need more work due to dynamic imports used
in the SDK, hence not included in this commit.
2025-10-14 10:25:42 -07:00
Akshay Srirangam 1df1e41183 Introduce unified TranscriptionOptions for better parameter management across providers. 2025-09-07 21:21:09 -07:00
Akshay Srirangam 716cff727d update poetry.lock for google-cloud-speech dependency 2025-08-15 01:00:16 -07:00
Akshay Srirangam c8b963b6e2 test: Add unit tests for ASR functionality 2025-08-14 20:00:26 -07:00
Yanis Miraoui ca22fd6572 mercury-coder-small --> mercury (#235) 2025-07-28 18:58:25 -07:00
Yanis Miraoui dea769272a Adding Inception Labs Provider (#226)
* inception provider and tests

* env variable and temp 0 for tests
2025-07-11 12:05:14 -07:00
Rohit Prasad bd6b23fd72 Tool calling support. Part I (#102)
Add tool calling support for most providers.
OpenAI, Groq, Anthropic, AWS, Mistral, SambaNova,
Cohere, xAI, Gemini & Azure.
2025-01-23 20:13:50 -08:00
Kevin Solorio c191980a0c Merge pull request #138 from Aktsvigun/main
Integration with Nebius AI Studio added
2024-12-29 13:43:59 -06:00
Rohit Prasad 5b83ec00f9 Test multiple providers. (#165)
This will be invoked by the GitHub workflow
each time a release is cut. This is part of
the pre-work for creating release automation.
Ignore the integration test using mark.
2024-12-26 14:20:18 -08:00
Akim Tsvigun 7b16009fe3 Merge branch 'main' into main 2024-12-24 17:52:26 +01:00
Dax 620b8c3f6b Merge branch 'main' into DaxConverge/add-watsonx-provider 2024-12-10 11:14:21 -05:00
Akim Tsvigun 9f587b3b13 Merge branch 'main' into main 2024-12-06 17:00:25 +01:00
Akim Tsvigun 7f5d9bfb37 test client conflict resolved 2024-12-06 16:59:16 +01:00
Akim Tsvigun d8cbbe8a80 Integration with Nebius AI Studio added 2024-12-06 16:54:32 +01:00
chris-stokes d678e05b0b Refactor unittest.TestCase to functional pytest 2024-11-30 22:03:44 +00:00
Dax Patel 5cd518eb81 Add Watsonx provider with tests using the python SDK 2024-11-28 16:36:54 -05:00
Rohit Prasad f2f05a5a27 Convention based loading of Provider modules. (#39)
* Convention based loading of Provider modules.

Loads the Provider class based on below
convention.
Eg:
  For "aws:model-name",
  1) look for providers/aws_provider.py
  2) load AwsProvider class from above file.

This allows convention based addition of
new providers.
2024-10-02 22:49:46 -07:00
Rohit Prasad ad46773ffb Re-added http based Fireworks & Together; Minor fixes. (#38)
Support for Fireworks provider using http.
Fixed few things based on the doc.
Support for Together using http requests.
Removing interface.py files
---------

Co-authored-by: Kevin Solorio <103829+ksolo@users.noreply.github.com>
2024-10-01 19:54:12 -07:00
Rohit Prasad f673f40fdf Provider specific package install options (#36)
* Provider specific package install options.

* Specifying extra package version.

- Fixed aws_bedrock to aws

* Updating poetry.lock file
2024-09-22 21:34:16 -07:00
Rohit Prasad 4bbb3a2701 Adding azure documentation, and minor changes. (#31)
* Adding azure documentation, and minor changes.

* Fixing test case, and adding better exception message.
2024-09-20 10:44:03 -07:00
standsleeping 1e5859baec Add Google to test_client.py 2024-09-17 22:45:57 -05:00
Kevin Solorio 8ad0fd7c18 port mistral interface to provider 2024-09-16 17:39:39 -05:00
Kevin Solorio 8bceb3572d add the groq provider 2024-09-12 22:21:51 -05:00
Rohit Prasad d77f3121ea Refactoring client and providers. (#27)
Added Azure support & refactored code.
Refactoring includes -
- ProviderFactory
- Lazily import the provider based on config passed to Client.

Will need to port the older provider files
to the new format. Till then keeping the
older provider interface related tests.

Co-authored-by: rohit-rptless <rohit@repeatless.cloud>
2024-09-12 12:14:28 -07:00
standsleeping 97ec95b8a5 New package name 2024-09-01 10:22:07 -05:00
standsleeping cee39794da Update client name 2024-07-21 14:20:49 -05:00
Kevin Solorio 721bc438c4 update tests directory structure 2024-07-14 15:40:10 -05:00