Skip to content

Feat/mcp interface#260

Merged
voorhs merged 13 commits intodevfrom
feat/mcp-interface
Aug 18, 2025
Merged

Feat/mcp interface#260
voorhs merged 13 commits intodevfrom
feat/mcp-interface

Conversation

@voorhs
Copy link
Copy Markdown
Collaborator

@voorhs voorhs commented Aug 15, 2025

с помощью энвов и команды autointent-http/autointent-mcp можно запустить сервер для обращения к автоинтенту

@voorhs voorhs requested a review from Samoed August 15, 2025 09:22
Comment thread autointent/server/http.py
"""Main entry point for the HTTP server."""
import uvicorn

uvicorn.run(
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Можно потом добавить пример как запускать с fastapi run

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

а зачем это может быть полезно? я никогда так не запускал, не шарю

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Альтернатива такому запуску https://fastapi.tiangolo.com/deployment/manually/. Тут можно поменять на uvicorn.run(app)

Comment thread autointent/server/mcp.py
from autointent.schemas import Intent


class Settings(BaseSettings):
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Мб вынести все модели куда-нибудь?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

пока что хочу держать все это изолировано от остальной части библиотеки

Comment thread autointent/server/mcp.py
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Мб разные паппки разделить http/mcp?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

зачем если все в одном файле пока что? когда файлов будет больше тогда и сделаем папки

Copy link
Copy Markdown
Member

@Samoed Samoed Aug 18, 2025

Choose a reason for hiding this comment

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

Модели запросов/настроек в отдельные файлы выделить

Comment thread autointent/server/mcp.py
samples_list.append(sample)

# Apply class filtering if specified
if class_filter is not None:
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Мб сначала отфильтровать, а потом добавлять?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

да как будто без разницы

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Если датасет большой будет, то наверное будет

Comment thread autointent/server/http.py
Comment thread autointent/server/http.py

model_config = SettingsConfigDict(env_file=".env", env_prefix="AUTOINTENT_")
path: str = Field(..., description="Path to the optimized pipeline assets")
host: str = "127.0.0.1"
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Suggested change
host: str = "127.0.0.1"
host: str = "0.0.0.0"

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

ruff ругается на это

Comment thread autointent/server/http.py
"""Application settings loaded from environment variables."""

model_config = SettingsConfigDict(env_file=".env", env_prefix="AUTOINTENT_")
path: str = Field(..., description="Path to the optimized pipeline assets")
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Suggested change
path: str = Field(..., description="Path to the optimized pipeline assets")
path: Path = Field(..., description="Path to the optimized pipeline assets")

@voorhs voorhs merged commit ee655bb into dev Aug 18, 2025
18 of 22 checks passed
@voorhs voorhs deleted the feat/mcp-interface branch August 18, 2025 07:40
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.

2 participants