Content-Length: 303385 | pFad | http://github.com/github/codespaces-models/pull/10/commits/c73634763cfee43c8374659fa9d1a893ebb63136

85 Update to Mistral Python SDK v1.0.1 by mor10 · Pull Request #10 · github/codespaces-models · GitHub
Skip to content

Update to Mistral Python SDK v1.0.1 #10

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

Open
wants to merge 15 commits into
base: main
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Update mistralai client in samples/multi_turn.py
  • Loading branch information
mor10 committed Aug 12, 2024
commit c73634763cfee43c8374659fa9d1a893ebb63136
15 changes: 7 additions & 8 deletions samples/python/mistralai/multi_turn.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@
"""

import os
from mistralai.client import MistralClient
from mistralai.models.chat_completion import ChatMessage
from mistralai import Mistral

token = os.environ["GITHUB_TOKEN"]
endpoint = "https://models.inference.ai.azure.com"
Expand All @@ -14,16 +13,16 @@
model_name = "Mistral-small"

# Create a client
client = MistralClient(api_key=token, endpoint=endpoint)
client = Mistral(api_key=token, server_url=endpoint)

# Call the chat completion API
response = client.chat(
response = client.chat.complete(
model=model_name,
messages=[
ChatMessage(role="system", content="You are a helpful assistant."),
ChatMessage(role="user", content="What is the capital of France?"),
ChatMessage(role="assistant", content="The capital of France is Paris."),
ChatMessage(role="user", content="What about Spain?"),
{"role":"system", "content":"You are a helpful assistant."},
{"role":"user", "content":"What is the capital of France?"},
{"role":"assistant", "content":"The capital of France is Paris."},
{"role":"user", "content":"What about Spain?"},
],
)

Expand Down








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: http://github.com/github/codespaces-models/pull/10/commits/c73634763cfee43c8374659fa9d1a893ebb63136

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy