init
This commit is contained in:
3
.env
3
.env
@@ -1,5 +1,4 @@
|
||||
#OPENAI_API_KEY="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"
|
||||
OPENAI_API_KEY="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"
|
||||
OPENAI_API_KEY="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"
|
||||
PORT=8010
|
||||
|
||||
LLM_PROVIDER=gpt-oss
|
||||
|
||||
2
.idea/misc.xml
generated
2
.idea/misc.xml
generated
@@ -3,5 +3,5 @@
|
||||
<component name="Black">
|
||||
<option name="sdkName" value="Python 3.9" />
|
||||
</component>
|
||||
<component name="ProjectRootManager" version="2" project-jdk-name="Python 3.9" project-jdk-type="Python SDK" />
|
||||
<component name="ProjectRootManager" version="2" project-jdk-name="ncuetalk" project-jdk-type="Python SDK" />
|
||||
</project>
|
||||
2
.idea/ncuetalk_backend.iml
generated
2
.idea/ncuetalk_backend.iml
generated
@@ -2,7 +2,7 @@
|
||||
<module type="PYTHON_MODULE" version="4">
|
||||
<component name="NewModuleRootManager">
|
||||
<content url="file://$MODULE_DIR$" />
|
||||
<orderEntry type="jdk" jdkName="Python 3.9" jdkType="Python SDK" />
|
||||
<orderEntry type="jdk" jdkName="ncuetalk" jdkType="Python SDK" />
|
||||
<orderEntry type="sourceFolder" forTests="false" />
|
||||
</component>
|
||||
</module>
|
||||
@@ -432,7 +432,14 @@ def list_ai_news(offset: int = 0, limit: int = 10):
|
||||
og = _extract_og(r["url"]) if r.get("url") else {"title":"","description":"","image":"","url":r.get("url")}
|
||||
r.update({"meta": og})
|
||||
enriched.append(r)
|
||||
return {"items": enriched, "nextOffset": offset + len(enriched)}
|
||||
# Frontend infinite-scroll safety:
|
||||
# - Return `nextOffset: null` when there is no next page.
|
||||
# - Otherwise return the next numeric offset.
|
||||
if len(enriched) < limit:
|
||||
next_offset = None
|
||||
else:
|
||||
next_offset = offset + len(enriched)
|
||||
return {"items": enriched, "nextOffset": next_offset}
|
||||
|
||||
@app.post("/community/ai_news")
|
||||
def create_ai_news(dto: AiNewsCreateDTO):
|
||||
|
||||
Reference in New Issue
Block a user