Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Restructure modules: separate use cases from API #87

Merged
merged 9 commits into from
Jun 17, 2024
Merged

Conversation

fjsj
Copy link
Member

@fjsj fjsj commented Jun 17, 2024

Closes #66

@fjsj fjsj requested a review from pamella June 17, 2024 14:23
@fjsj fjsj marked this pull request as ready for review June 17, 2024 14:24
@fjsj fjsj requested a review from amandasavluchinske June 17, 2024 14:24
Tool,
method_tool,
tool,
)
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've added all the main public API here (in traditional API sense, not web API) he

# Force "operationId" to be like "django_ai_assistant_delete_thread"
def get_openapi_operation_id(self, operation: Operation) -> str:
name = operation.view_func.__name__
return (package_name + "_" + name).replace(".", "_")
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This makes us have better names at frontend/src/client/services.gen.ts

Like djangoAiAssistantListAssistants instead of djangoAiAssistantViewsListAssistants

@@ -309,154 +298,3 @@ def as_tool(self, description) -> BaseTool:
def register_assistant(cls: type[AIAssistant]):
ASSISTANT_CLS_REGISTRY[cls.id] = cls
return cls


Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Moved to use_cases

Copy link
Contributor

@amandasavluchinske amandasavluchinske left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a small suggestion.

django_ai_assistant/urls.py Outdated Show resolved Hide resolved
@amandasavluchinske amandasavluchinske self-requested a review June 17, 2024 15:07
Copy link
Contributor

@amandasavluchinske amandasavluchinske left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually, it seems like tests are also failing.

Copy link
Collaborator

@pamella pamella left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@fjsj fjsj merged commit 9579846 into main Jun 17, 2024
6 checks passed
@fjsj fjsj deleted the fix/move-modules branch June 17, 2024 17:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Separate API views and helpers in api dir
3 participants