Skip to content

Commit

Permalink
Adding files_list param to all calls
Browse files Browse the repository at this point in the history
  • Loading branch information
johnjosephhorton committed Sep 30, 2024
1 parent 064b0e5 commit 819125f
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 10 deletions.
8 changes: 5 additions & 3 deletions edsl/inference_services/AnthropicService.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import os
from typing import Any
from typing import Any, Optional, List
import re
from anthropic import AsyncAnthropic
from edsl.inference_services.InferenceServiceABC import InferenceServiceABC
Expand Down Expand Up @@ -60,8 +60,10 @@ class LLM(LanguageModel):
_rpm = cls.get_rpm(cls)

async def async_execute_model_call(
self, user_prompt: str, system_prompt: str = "",
files_list: Optional[List['Files']] = None
self,
user_prompt: str,
system_prompt: str = "",
files_list: Optional[List["Files"]] = None,
) -> dict[str, Any]:
"""Calls the OpenAI API and returns the API response."""

Expand Down
7 changes: 5 additions & 2 deletions edsl/inference_services/AwsBedrock.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import os
from typing import Any
from typing import Any, List, Optional
import re
import boto3
from botocore.exceptions import ClientError
Expand Down Expand Up @@ -69,7 +69,10 @@ class LLM(LanguageModel):
_tpm = cls.get_tpm(cls)

async def async_execute_model_call(
self, user_prompt: str, system_prompt: str = ""
self,
user_prompt: str,
system_prompt: str = "",
files_list: Optional[List["FileStore"]] = None,
) -> dict[str, Any]:
"""Calls the AWS Bedrock API and returns the API response."""

Expand Down
7 changes: 5 additions & 2 deletions edsl/inference_services/AzureAI.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import os
from typing import Any
from typing import Any, Optional, List
import re
from openai import AsyncAzureOpenAI
from edsl.inference_services.InferenceServiceABC import InferenceServiceABC
Expand Down Expand Up @@ -122,7 +122,10 @@ class LLM(LanguageModel):
_tpm = cls.get_tpm(cls)

async def async_execute_model_call(
self, user_prompt: str, system_prompt: str = ""
self,
user_prompt: str,
system_prompt: str = "",
files_list: Optional[List["FileStore"]] = None,
) -> dict[str, Any]:
"""Calls the Azure OpenAI API and returns the API response."""

Expand Down
7 changes: 5 additions & 2 deletions edsl/inference_services/MistralAIService.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import os
from typing import Any, List
from typing import Any, List, Optional
from edsl.inference_services.InferenceServiceABC import InferenceServiceABC
from edsl.language_models.LanguageModel import LanguageModel
import asyncio
Expand Down Expand Up @@ -95,7 +95,10 @@ def async_client(self):
return cls.async_client()

async def async_execute_model_call(
self, user_prompt: str, system_prompt: str = ""
self,
user_prompt: str,
system_prompt: str = "",
files_list: Optional[List["FileStore"]] = None,
) -> dict[str, Any]:
"""Calls the Mistral API and returns the API response."""
s = self.async_client()
Expand Down
2 changes: 1 addition & 1 deletion edsl/inference_services/TogetherAIService.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import aiohttp
import json
import requests
from typing import Any, List
from typing import Any, List, Optional

# from edsl.inference_services.InferenceServiceABC import InferenceServiceABC
from edsl.language_models import LanguageModel
Expand Down

0 comments on commit 819125f

Please sign in to comment.