Skip to content

Commit

Permalink
default model for agents right now
Browse files Browse the repository at this point in the history
  • Loading branch information
scott-cohere committed Jun 19, 2024
1 parent 9b9f845 commit 6b30471
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 3 deletions.
4 changes: 3 additions & 1 deletion src/backend/services/chat.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,9 @@ def process_chat(
# Set the agent settings in the chat request
chat_request.preamble = agent.preamble
chat_request.tools = [Tool(name=tool) for tool in agent.tools]
chat_request.model = agent.model
# NOTE TEMPORARY: we do not set a the model for now and just use the default model
chat_request.model = None
# chat_request.model = agent.model

should_store = chat_request.chat_history is None and not is_custom_tool_call(
chat_request
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,7 @@ export class DefaultService {
* session (DBSessionDep): Database session.
* chat_request (CohereChatRequest): Chat request data.
* request (Request): Request object.
* agent_id (str | None): Agent ID.
*
* Returns:
* EventSourceResponse: Server-sent event response with chatbot responses.
Expand All @@ -169,12 +170,17 @@ export class DefaultService {
*/
public static chatStreamV1ChatStreamPost({
requestBody,
agentId,
}: {
requestBody: CohereChatRequest;
agentId?: string | null;
}): CancelablePromise<Array<ChatResponseEvent>> {
return __request(OpenAPI, {
method: 'POST',
url: '/v1/chat-stream',
query: {
agent_id: agentId,
},
body: requestBody,
mediaType: 'application/json',
errors: {
Expand All @@ -190,6 +196,7 @@ export class DefaultService {
* chat_request (CohereChatRequest): Chat request data.
* session (DBSessionDep): Database session.
* request (Request): Request object.
* agent_id (str | None): Agent ID.
*
* Returns:
* NonStreamedChatResponse: Chatbot response.
Expand All @@ -198,12 +205,17 @@ export class DefaultService {
*/
public static chatV1ChatPost({
requestBody,
agentId,
}: {
requestBody: CohereChatRequest;
agentId?: string | null;
}): CancelablePromise<NonStreamedChatResponse> {
return __request(OpenAPI, {
method: 'POST',
url: '/v1/chat',
query: {
agent_id: agentId,
},
body: requestBody,
mediaType: 'application/json',
errors: {
Expand Down Expand Up @@ -825,7 +837,7 @@ export class DefaultService {
});
}
/**
* Get Agent
* Get Agent By Id
* Args:
* agent_id (str): Agent ID.
* session (DBSessionDep): Database session.
Expand All @@ -838,7 +850,7 @@ export class DefaultService {
* @returns Agent Successful Response
* @throws ApiError
*/
public static getAgentV1AgentsAgentIdGet({
public static getAgentByIdV1AgentsAgentIdGet({
agentId,
}: {
agentId: string;
Expand Down

0 comments on commit 6b30471

Please sign in to comment.