Skip to content

Commit

Permalink
Merge branch 'main' into feature/update-copilots
Browse files Browse the repository at this point in the history
  • Loading branch information
mnicstruwig committed Oct 16, 2024
2 parents 4486bf4 + 7849254 commit 60c2c70
Show file tree
Hide file tree
Showing 6 changed files with 922 additions and 475 deletions.
9 changes: 7 additions & 2 deletions llama31-local-copilot/llama_copilot/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,14 +76,19 @@ async def query(request: AgentQueryRequest) -> EventSourceResponse:
elif message.role == "human":
chat_messages.append(UserMessage(content=sanitize_message(message.content)))

if request.context:
chat_messages.insert(1, UserMessage(content=sanitize_message("# Context\n" + str(request.context))))

@chatprompt(
SystemMessage(SYSTEM_PROMPT),
*chat_messages,
model=LitellmChatModel(model="ollama_chat/llama3.1:8b-instruct-q6_K"),
)
async def _llm(context: str) -> AsyncStreamedStr: ...
async def _llm() -> AsyncStreamedStr:
...


result = await _llm(context=request.context)
result = await _llm()
return EventSourceResponse(
content=create_message_stream(result),
media_type="text/event-stream",
Expand Down
6 changes: 0 additions & 6 deletions llama31-local-copilot/llama_copilot/prompts.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,4 @@
- Subject-Specific Jargon: Use industry-specific terms, ensuring they are accessible to a general audience through explanations.
- Narrative Flow: Ensure a logical flow, connecting ideas and points effectively.
- Incorporate Statistics and Examples: Support points with relevant statistics, examples, or case studies for real-world context.
## Context
Use the following context to help formulate your answer:
{context}
"""
Loading

0 comments on commit 60c2c70

Please sign in to comment.