Skip to content

Commit

Permalink
fix createuser issues
Browse files Browse the repository at this point in the history
  • Loading branch information
tianjing-li committed Oct 23, 2024
1 parent 66dc2c4 commit 82ad4f1
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 13 deletions.
2 changes: 1 addition & 1 deletion src/backend/schemas/agent.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import datetime
from enum import StrEnum
from typing import Any, Dict, Optional
from typing import Optional

from pydantic import BaseModel, Field

Expand Down
1 change: 1 addition & 0 deletions src/backend/services/agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
from backend.database_models.agent import Agent, AgentToolMetadata
from backend.database_models.database import DBSessionDep


def validate_agent_exists(session: DBSessionDep, agent_id: str, user_id: str) -> Agent:
agent = agent_crud.get_agent_by_id(session, agent_id, user_id)

Expand Down
8 changes: 3 additions & 5 deletions src/interfaces/assistants_web/src/cohere-client/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import {
CohereUnauthorizedError,
CreateAgentRequest,
CreateSnapshotRequest,
CreateUser,
CreateUserV1UsersPostData,
Fetch,
ToggleConversationPinRequest,
UpdateAgentRequest,
Expand Down Expand Up @@ -206,10 +206,8 @@ export class CohereClient {
return this.cohereService.default.getStrategiesV1AuthStrategiesGet();
}

public createUser(requestBody: CreateUser) {
return this.cohereService.default.createUserV1UsersPost({
requestBody,
});
public createUser(requestBody: CreateUserV1UsersPostData) {
return this.cohereService.default.createUserV1UsersPost(requestBody);
}

public async googleSSOAuth({ code }: { code: string }) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -957,7 +957,7 @@ export class DefaultService {
* Response: Synthesized audio file.
*
* Raises:
* HTTPException: If the message with the given ID is not found.
* HTTPException: If the message with the given ID is not found or synthesis fails.
* @param data The data for the request.
* @param data.conversationId
* @param data.messageId
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,9 @@ import {
LongPressMenu,
} from '@/components/UI';
import { Breakpoint, useBreakpoint } from '@/hooks';
import { useSettingsStore } from '@/stores';
import { useExperimentalFeatures } from '@/hooks/use-experimentalFeatures';
import { SynthesisStatus } from '@/hooks/use-synthesizer';

import { useSettingsStore } from '@/stores';
import {
type ChatMessage,
isAbortedMessage,
Expand Down Expand Up @@ -68,7 +67,7 @@ export const MessageRow = forwardRef<HTMLDivElement, Props>(function MessageRowI
// For showing thinking steps
const { showSteps } = useSettingsStore();
const [isStepsExpanded, setIsStepsExpanded] = useState(true);

useEffect(() => {
setIsStepsExpanded(showSteps);
}, [showSteps]);
Expand Down
8 changes: 5 additions & 3 deletions src/interfaces/assistants_web/src/hooks/use-session.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,9 +72,11 @@ export const useSession = () => {
const registerMutation = useMutation({
mutationFn: async (params: RegisterParams) => {
return cohereClient.createUser({
fullname: params.name,
email: params.email,
password: params.password,
requestBody: {
fullname: params.name,
email: params.email,
password: params.password,
},
});
},
});
Expand Down

0 comments on commit 82ad4f1

Please sign in to comment.