Skip to content

Commit

Permalink
Add latest models to agent
Browse files Browse the repository at this point in the history
  • Loading branch information
ajhai committed Nov 12, 2023
1 parent 29682c4 commit fe6a444
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
9 changes: 6 additions & 3 deletions llmstack/apps/types/agent.py
Original file line number Diff line number Diff line change
@@ -1,17 +1,19 @@
from enum import Enum
from typing import List, Optional

from pydantic import Field

from llmstack.apps.types.app_type_interface import AppTypeInterface
from llmstack.apps.types.app_type_interface import BaseSchema
from llmstack.apps.types.app_type_interface import AppTypeInterface, BaseSchema
from llmstack.processors.providers.api_processor_interface import DataUrl


class AgentModel(str, Enum):
GPT_3_5_LATEST = 'gpt-3.5-turbo-latest'
GPT_3_5 = 'gpt-3.5-turbo'
GPT_3_5_16K = 'gpt-3.5-turbo-16k'
GPT_4 = 'gpt-4'
GPT_4_32K = 'gpt-4-32k'
GPT_4_LATEST = 'gpt-4-turbo-latest'

def __str__(self):
return self.value
Expand All @@ -24,10 +26,11 @@ class RendererType(str, Enum):
def __str__(self):
return self.value


class AgentConfigSchema(BaseSchema):
model: AgentModel = Field(
title='Model',
default=AgentModel.GPT_3_5, description='The model to use for the agent.',
default=AgentModel.GPT_3_5_LATEST, description='The model to use for the agent.',
)
system_message: str = Field(
title='System Message',
Expand Down
5 changes: 5 additions & 0 deletions llmstack/play/actors/agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,11 @@ def on_receive(self, message: Message) -> Any:

model = self._config.get('model', 'gpt-3.5-turbo')

if model == 'gpt-3.5-turbo-latest':
model = 'gpt-3.5-turbo-1106'
elif model == 'gpt-4-turbo-latest':
model = 'gpt-4-1106-preview'

# Make one call to the model
full_content = ''
function_name = ''
Expand Down

0 comments on commit fe6a444

Please sign in to comment.