Cloud LLM chat / Q&A
Connect a cloud AI assistant so users can ask in natural language and get answers.
The problem today
You want smart Q&A but don't know how to wire an LLM, and worry about China access.
What you get
- A conversational AI assistant
- Multi-turn dialogue with context
- Stable cloud model calls
Copy the whole block below and paste it into Codex. Replace placeholders like API keys with real values from the IFQ Cloud console.
You are a senior full-stack engineer. In my currently open local project, add a "cloud AI chat assistant" so users ask in natural language and get answers.
[Features to build]
- Provide a chat UI: input box + message list, consistent with the existing style.
- Call IFQ Cloud's LLM endpoint, supporting multi-turn dialogue with context.
- Stream answers (show as they generate) with a "thinking" loading state.
- Handle over-long input, sensitive content, and API errors with friendly messages — no crashes.
[Connect to IFQ Cloud]
- API base https://api.cloud.ifq.ai, official SDK `jieshi-cloud` (if unavailable, use plain HTTPS equivalently and note the endpoint in a comment).
- Secrets via environment variables, never hard-coded: JIESHI_CLOUD_API_KEY, JIESHI_CLOUD_PROJECT_ID; generate `.env.example` with both, noting "get real values from the IFQ Cloud console and replace".
- All placeholders; without real values, run on placeholders and print a hint on where to replace them.
[Engineering requirements]
- Read the existing structure and stack first; follow current conventions, add only necessary files, leave unrelated code untouched.
- Network calls: timeout + graceful fallback; friendly errors, never crash.
- Demo / mock mode: the main flow runs on sample data without keys.
- Include a minimal runnable self-test with run instructions.
- On completion list: files changed / how to start / how to roll back.
Ask before any decision point.
*— [ifq.ai](https://work.ifq.ai/) · AI-augmented. Full-stack crafted*