mirror of
https://github.com/xtekky/gpt4free.git
synced 2025-12-06 02:30:41 -08:00
Read FinishReason and Usage from Gemini API
Add "Custom Provider": Set API Url in the settings Remove Discord link from result, add them to attr: Jmuz Fix Bug: File content are added to the prompt Changed response from /v1/models API Disable Pizzagpt Provider
This commit is contained in:
parent
2b5f6a4259
commit
2df2d6b0cf
11 changed files with 81 additions and 57 deletions
|
|
@ -37,12 +37,12 @@ class Api:
|
|||
for model, providers in models.__models__.values()]
|
||||
|
||||
@staticmethod
|
||||
def get_provider_models(provider: str, api_key: str = None):
|
||||
def get_provider_models(provider: str, api_key: str = None, api_base: str = None):
|
||||
if provider in ProviderUtils.convert:
|
||||
provider = ProviderUtils.convert[provider]
|
||||
if issubclass(provider, ProviderModelMixin):
|
||||
if api_key is not None and "api_key" in signature(provider.get_models).parameters:
|
||||
models = provider.get_models(api_key=api_key)
|
||||
models = provider.get_models(api_key=api_key, api_base=api_base)
|
||||
else:
|
||||
models = provider.get_models()
|
||||
return [
|
||||
|
|
@ -90,6 +90,9 @@ class Api:
|
|||
api_key = json_data.get("api_key")
|
||||
if api_key is not None:
|
||||
kwargs["api_key"] = api_key
|
||||
api_base = json_data.get("api_base")
|
||||
if api_base is not None:
|
||||
kwargs["api_base"] = api_base
|
||||
kwargs["tool_calls"] = [{
|
||||
"function": {
|
||||
"name": "bucket_tool"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue